]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - plugins/markdown/markdown.php
Merge pull request #1205 from ArthurHoaro/feature/opengraph
[github/shaarli/Shaarli.git] / plugins / markdown / markdown.php
index d4fb1f76ab4613244de2b0dfe4885e804eb16aed..08e64dae087e1a9828bd23d8c0f54680c485e263 100644 (file)
@@ -216,6 +216,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;