Skip to content

Commit

Permalink
make id in header optional in headerid regex fix #497
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-peugnet committed Dec 21, 2024
1 parent 3778e1f commit 81b028d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/class/Servicerender.php
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ protected function headerid(string $text, int $min, int $max, int $anchormode, s
}

$text = preg_replace_callback(
"/<h([$min-$max])((.*)id=\"([^\"]*)\"(.*)|.*)>(.+)<\/h[$min-$max]>/mU",
"/<h([$min-$max])((.*)id=\"([^\"]*)\"(.*)|.*)?>(.+)<\/h[$min-$max]>/mU",
function ($matches) use ($element, $anchormode) {
$level = $matches[1];
$beforeid = $matches[3];
Expand Down

0 comments on commit 81b028d

Please sign in to comment.