aboutsummaryrefslogtreecommitdiffstats
path: root/include/markdown.php
diff options
context:
space:
mode:
authorManuel Jiménez Friaza <mjfriaza@openmailbox.org>2019-08-11 10:39:03 +0200
committerManuel Jiménez Friaza <mjfriaza@openmailbox.org>2019-08-11 10:39:03 +0200
commitb89d2d7580e40cd417defaffd2514b5eed38577d (patch)
tree78ba9004d87b994dd9a531b475fd51b940bf3dd8 /include/markdown.php
parent350e636e3d0a44323c69185555e89cc01a213aa2 (diff)
parent047dd31724f8da12c153b4a6f27dc5462f7b97e5 (diff)
downloadvolse-hubzilla-b89d2d7580e40cd417defaffd2514b5eed38577d.tar.gz
volse-hubzilla-b89d2d7580e40cd417defaffd2514b5eed38577d.tar.bz2
volse-hubzilla-b89d2d7580e40cd417defaffd2514b5eed38577d.zip
Merge remote-tracking branch 'upstream/dev' into dev
Diffstat (limited to 'include/markdown.php')
-rw-r--r--include/markdown.php4
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);