diff options
author | zotlabs <mike@macgirvin.com> | 2019-05-28 16:16:29 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2019-05-28 16:16:29 -0700 |
commit | 932b4140637e22e9fb4ff3a91a9c8f186915646b (patch) | |
tree | c6e6b8c19079d34fda0fa11d3af26ddef69ae2b6 /include/markdown.php | |
parent | 7c2aafd4ee123f9db1ea2733119e0711f53414cc (diff) | |
parent | ca8d252ad75306e6d3cd066d5c593e94de1dfbdd (diff) | |
download | volse-hubzilla-932b4140637e22e9fb4ff3a91a9c8f186915646b.tar.gz volse-hubzilla-932b4140637e22e9fb4ff3a91a9c8f186915646b.tar.bz2 volse-hubzilla-932b4140637e22e9fb4ff3a91a9c8f186915646b.zip |
Merge branch 'dev' of https://framagit.org/hubzilla/core into dev
Diffstat (limited to 'include/markdown.php')
-rw-r--r-- | include/markdown.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/markdown.php b/include/markdown.php index 2513a7d77..7d1f16958 100644 --- a/include/markdown.php +++ b/include/markdown.php @@ -76,6 +76,8 @@ function markdown_to_bb($s, $use_zrl = false, $options = []) { $s = html2bbcode($s); + $s = bb_code_protect($s); + // Convert everything that looks like a link to a link if($use_zrl) { if (strpos($s,'[/img]') !== false) { @@ -88,6 +90,8 @@ function markdown_to_bb($s, $use_zrl = false, $options = []) { $s = preg_replace("/([^\]\=\{\/]|^)(https?\:\/\/)([a-zA-Z0-9\pL\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,\@\(\)]+)/ismu", '$1[url=$2$3]$2$3[/url]',$s); } + $s = bb_code_unprotect($s); + // remove duplicate adjacent code tags $s = preg_replace("/(\[code\])+(.*?)(\[\/code\])+/ism","[code]$2[/code]", $s); |