Skip to content

Commit 84e3a56

Browse files
authored
Merge pull request #209 from Findus23/fix-sidebar-anchor-links
remove html entities from #id-links in sidebar
2 parents b234d59 + fb3599a commit 84e3a56

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

app/helpers/Markdown/TitleIdPreprocessor.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public static function headlineTextToHtmlId($headlineText)
4545
{
4646
$headlineText = strip_tags($headlineText);
4747
$headlineText = trim($headlineText);
48+
$headlineText = preg_replace("/&#?[a-z0-9]{2,8}; /i","",$headlineText); // remove "& " from string
4849
$headlineText = preg_replace('/\s/', '-', $headlineText);
4950
$headlineText = preg_replace('/[^a-zA-Z0-9\-\_]/', '', $headlineText);
5051
$headlineText = preg_replace('/(\-)+/', '-', $headlineText);

0 commit comments

Comments
 (0)