parser/table of contents: ensure [__TOC__] is on a line by itself

This commit is contained in:
Starbeamrainbowlabs 2020-05-23 22:30:12 +01:00
parent 2b7add3f4f
commit 9a4467bc9f
Signed by: sbrl
GPG Key ID: 1BE5172E637709C2
1 changed files with 1 additions and 1 deletions

View File

@ -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 = [