X-Git-Url: https://git.immae.eu/?p=github%2Fshaarli%2FShaarli.git;a=blobdiff_plain;f=plugins%2Fmarkdown%2Fmarkdown.php;h=21972814c046182f3e818a83787ff92111e96d19;hp=821bb12511bf15b98aba0dab6b757c0fc15079a5;hb=cb7940e2deacba66f2510816732be654b255cc70;hpb=f28b73b21f705102f8536cd16ea28122aa870e49 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;