From cb7940e2deacba66f2510816732be654b255cc70 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Tue, 14 Aug 2018 12:26:51 +0200 Subject: Fix hashtags with markdown escape enabled They're now transformed to markdown syntax links before processing them through Parsedown. Fixes #1210 --- plugins/markdown/markdown.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'plugins') diff --git a/plugins/markdown/markdown.php b/plugins/markdown/markdown.php index 821bb125..21972814 100644 --- a/plugins/markdown/markdown.php +++ b/plugins/markdown/markdown.php @@ -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( + '#([^<]+)#m', + '[$2]($1)', + $descriptionLine + ); + } + $descriptionOut .= $descriptionLine; if ($lineCount++ < count($descriptionLines) - 1) { $descriptionOut .= PHP_EOL; -- cgit v1.2.3