]> git.mxchange.org Git - friendica.git/commitdiff
Markdown - fixed bug in local anchor links
authorpeter <peter@jean-luc-picard>
Sun, 3 Feb 2019 02:23:47 +0000 (03:23 +0100)
committerpeter <peter@jean-luc-picard>
Sun, 3 Feb 2019 02:23:47 +0000 (03:23 +0100)
src/Content/Text/Markdown.php

index e54234bffefc13cafe45c08935a5dd341579f674..4e00ae78102624e8e2f66bdce15dc9415cf149ed 100644 (file)
@@ -34,6 +34,7 @@ class Markdown extends BaseObject
                $MarkdownParser->hard_wrap = $hardwrap;
                $MarkdownParser->code_class_prefix = 'language-';
                $html = $MarkdownParser->transform($text);
+               $html = str_replace('<a href="#', '<a href="' . ltrim($_SERVER['REQUEST_URI'], '/') . '#', $html);
 
                self::getApp()->saveTimestamp($stamp1, "parser");