summaryrefslogtreecommitdiff
path: root/lib/MyParsedown.php
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2023-03-04 01:46:45 +0300
committerEvgeny Zinoviev <me@ch1p.io>2023-03-04 01:46:45 +0300
commiteeb84c5be16ecca239adae9c851bc0f7db0875a1 (patch)
tree9aa1056e643212e4c6133d90f38a1966f0fa35ca /lib/MyParsedown.php
parent917d2622aa5fe748c1cda914eae94c12be743c42 (diff)
blog: support ToC
Diffstat (limited to 'lib/MyParsedown.php')
-rw-r--r--lib/MyParsedown.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/MyParsedown.php b/lib/MyParsedown.php
index cd537bc..85ed9c4 100644
--- a/lib/MyParsedown.php
+++ b/lib/MyParsedown.php
@@ -3,13 +3,18 @@
class MyParsedown extends ParsedownExtended {
public function __construct(
+ ?array $opts = null,
protected bool $useImagePreviews = false
) {
- parent::__construct([
+ $parsedown_opts = [
'tables' => [
'tablespan' => true
]
- ]);
+ ];
+ if (!is_null($opts)) {
+ $parsedown_opts = array_merge($parsedown_opts, $opts);
+ }
+ parent::__construct($parsedown_opts);
$this->InlineTypes['{'][] = 'FileAttach';
$this->InlineTypes['{'][] = 'Image';