]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #4331 from annando/other-hashtags
authorHypolite Petovan <mrpetovan@gmail.com>
Thu, 25 Jan 2018 15:02:04 +0000 (10:02 -0500)
committerGitHub <noreply@github.com>
Thu, 25 Jan 2018 15:02:04 +0000 (10:02 -0500)
Support for hashtags with "#" inside the link (mastodon style?)

include/bbcode.php

index 3731e7f449551ddc2fadef663760078b4149379c..f95c911d5eb299e081b925cf44675dcb0523a7d6 100644 (file)
@@ -1051,6 +1051,9 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = fa
        $Text = preg_replace("/([#])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
                                '$1<a href="' . System::baseUrl() . '/search?tag=$3" class="tag" title="$3">$3</a>', $Text);
 
+       $Text = preg_replace("/\[url\=([$URLSearchString]*)\]#(.*?)\[\/url\]/ism",
+                               '#<a href="' . System::baseUrl() . '/search?tag=$2" class="tag" title="$2">$2</a>', $Text);
+
        $Text = preg_replace("/\[url\]([$URLSearchString]*)\[\/url\]/ism", '<a href="$1" target="_blank">$1</a>', $Text);
        $Text = preg_replace("/\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", '<a href="$1" target="_blank">$2</a>', $Text);
        //$Text = preg_replace("/\[url\=([$URLSearchString]*)\]([$URLSearchString]*)\[\/url\]/ism", '<a href="$1" target="_blank">$2</a>', $Text);