mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 23:55:19 +00:00
try again - ignore linkifying naked links inside parens, which may be markdown links and would otherwise be linkified twice
This commit is contained in:
parent
25f9c83da6
commit
9495e90bc5
2 changed files with 2 additions and 8 deletions
|
@ -3481,9 +3481,9 @@ function cleanup_bbcode($body) {
|
|||
$body = preg_replace_callback('/\[zrl(.*?)\[\/(zrl)\]/ism','\red_escape_codeblock',$body);
|
||||
$body = preg_replace_callback('/\[svg(.*?)\[\/(svg)\]/ism','\red_escape_codeblock',$body);
|
||||
|
||||
$body = preg_replace_callback("/([^\]\='".'"'."\;\/\{]|^|\#\^)(https?\:\/\/[a-zA-Z0-9\pL\:\/\-\?\&\;\.\=\@\_\~\#\%\$\!\\+\,\(\)]+)/ismu", '\nakedoembed', $body);
|
||||
$body = preg_replace_callback("/([^\]\='".'"'."\;\/\{\(]|^|\#\^)(https?\:\/\/[a-zA-Z0-9\pL\:\/\-\?\&\;\.\=\@\_\~\#\%\$\!\\+\,\(\)]+)/ismu", '\nakedoembed', $body);
|
||||
|
||||
$body = preg_replace_callback("/([^\]\='".'"'."\;\/\{]|^|\#\^)(https?\:\/\/[a-zA-Z0-9\pL\:\/\-\?\&\;\.\=\@\_\~\#\%\$\!\\+\,\(\)]+)/ismu", '\red_zrl_callback', $body);
|
||||
$body = preg_replace_callback("/([^\]\='".'"'."\;\/\{\(]|^|\#\^)(https?\:\/\/[a-zA-Z0-9\pL\:\/\-\?\&\;\.\=\@\_\~\#\%\$\!\\+\,\(\)]+)/ismu", '\red_zrl_callback', $body);
|
||||
|
||||
|
||||
$body = preg_replace_callback('/\[\$b64code(.*?)\[\/(code)\]/ism','\red_unescape_codeblock',$body);
|
||||
|
|
|
@ -214,12 +214,6 @@ function red_zrl_callback($matches) {
|
|||
$matches[2] = $t;
|
||||
}
|
||||
|
||||
// this is a markdown link - ignore; as it will be handled by the bbcode parser.
|
||||
|
||||
if ($matches[1] === "(" ) {
|
||||
return $matches[0];
|
||||
}
|
||||
|
||||
if($matches[1] === '#^')
|
||||
$matches[1] = '';
|
||||
if($zrl)
|
||||
|
|
Loading…
Reference in a new issue