Fix hashtags with markdown escape enabled
They're now transformed to markdown syntax links before processing them through Parsedown. Fixes #1210
This commit is contained in:
parent
f28b73b21f
commit
cb7940e2de
6 changed files with 47 additions and 6 deletions
plugins/markdown
|
@ -215,6 +215,15 @@ function reverse_text2clickable($description)
|
|||
$descriptionLine
|
||||
);
|
||||
|
||||
// Make hashtag links markdown ready, otherwise the links will be ignored with escape set to true
|
||||
if (!$codeBlockOn && !$codeLineOn) {
|
||||
$descriptionLine = preg_replace(
|
||||
'#<a href="([^ ]*)"'. $hashtagTitle .'>([^<]+)</a>#m',
|
||||
'[$2]($1)',
|
||||
$descriptionLine
|
||||
);
|
||||
}
|
||||
|
||||
$descriptionOut .= $descriptionLine;
|
||||
if ($lineCount++ < count($descriptionLines) - 1) {
|
||||
$descriptionOut .= PHP_EOL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue