parser/table of contents: ensure [__TOC__] is on a line by itself
This commit is contained in:
parent
2b7add3f4f
commit
9a4467bc9f
|
@ -1390,7 +1390,7 @@ class PeppermintParsedown extends ParsedownExtra
|
|||
// Indent? Don't even want to know
|
||||
if($fragment["indent"] > 0) return;
|
||||
// If it doesn't match, then we're not interested
|
||||
if(preg_match('/\[_*(?:TOC|toc)_*\]/u', $fragment["text"], $matches) !== 1)
|
||||
if(preg_match('/^\[_*(?:TOC|toc)_*\]$/u', $fragment["text"], $matches) !== 1)
|
||||
return;
|
||||
|
||||
$result = [
|
||||
|
|
Loading…
Reference in New Issue