1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-11-22 04:23:01 +00:00

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

View file

@ -1390,7 +1390,7 @@ class PeppermintParsedown extends ParsedownExtra
// Indent? Don't even want to know // Indent? Don't even want to know
if($fragment["indent"] > 0) return; if($fragment["indent"] > 0) return;
// If it doesn't match, then we're not interested // 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; return;
$result = [ $result = [