]> git.mxchange.org Git - friendica.git/commitdiff
Remove preemptive autolinker from Text\Markdown::toBBCode
authorHypolite Petovan <hypolite@mrpetovan.com>
Wed, 6 May 2020 03:41:35 +0000 (23:41 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Wed, 6 May 2020 03:41:35 +0000 (23:41 -0400)
- Autolinker is done centrally in Text\BBCode::convert

src/Content/Text/Markdown.php

index f5ad85e805453fcdef4b280826d7c73d0205ba75..71437fb350b33441812b643d01ace331579a8245 100644 (file)
@@ -122,9 +122,6 @@ class Markdown
                // protect the recycle symbol from turning into a tag, but without unescaping angles and naked ampersands
                $s = str_replace('&#x2672;', html_entity_decode('&#x2672;', ENT_QUOTES, 'UTF-8'), $s);
 
-               // Convert everything that looks like a link to a link
-               $s = preg_replace('/([^\]=]|^)(https?\:\/\/)([a-zA-Z0-9:\/\-?&;.=_~#%$!+,@]+(?<!,))/ism', '$1[url=$2$3]$2$3[/url]', $s);
-
                //$s = preg_replace("/([^\]\=]|^)(https?\:\/\/)(vimeo|youtu|www\.youtube|soundcloud)([a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)/ism", '$1[url=$2$3$4]$2$3$4[/url]',$s);
                $s = BBCode::pregReplaceInTag('/\[url\=?(.*?)\]https?:\/\/www.youtube.com\/watch\?v\=(.*?)\[\/url\]/ism', '[youtube]$2[/youtube]', 'url', $s);
                $s = BBCode::pregReplaceInTag('/\[url\=https?:\/\/www.youtube.com\/watch\?v\=(.*?)\].*?\[\/url\]/ism'   , '[youtube]$1[/youtube]', 'url', $s);