diff options
author | zotlabs <mike@macgirvin.com> | 2016-10-12 15:25:48 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2016-10-12 15:25:48 -0700 |
commit | cfc61a69ef80de70b1e4e29666f8beb4b80406fc (patch) | |
tree | d1285975c0fb3974ffcca3ce836f8dc6c3a8cd6c /include | |
parent | ae62d3081173078885e3f1323e324d2797995027 (diff) | |
download | volse-hubzilla-cfc61a69ef80de70b1e4e29666f8beb4b80406fc.tar.gz volse-hubzilla-cfc61a69ef80de70b1e4e29666f8beb4b80406fc.tar.bz2 volse-hubzilla-cfc61a69ef80de70b1e4e29666f8beb4b80406fc.zip |
bbcode: remove the inserted <br /> between list elements due to linefeeds in the textarea.
Diffstat (limited to 'include')
-rw-r--r-- | include/bbcode.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/bbcode.php b/include/bbcode.php index a82b658b1..c3041c6a6 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -784,6 +784,9 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $cache = false) $Text = preg_replace("(\[footer\](.*?)\[\/footer\])ism", "<div class=\"wall-item-footer\">$1</div>", $Text); } // Check for list text + + $Text = preg_replace("/<br \/>\[\*\]/ism",'[*]',$Text); + $Text = str_replace("[*]", "<li>", $Text); $Text = str_replace("[]", "<li><input type=\"checkbox\" disabled=\"disabled\">", $Text); $Text = str_replace("[x]", "<li><input type=\"checkbox\" checked=\"checked\" disabled=\"disabled\">", $Text); @@ -807,6 +810,7 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $cache = false) $Text = preg_replace("/\[checklist\](.*?)\[\/checklist\]/ism", '<ul class="checklist" style="list-style-type: none;">$1</ul>', $Text); $Text = preg_replace("/\[ul\](.*?)\[\/ul\]/ism", '<ul class="listbullet" style="list-style-type: circle;">$1</ul>', $Text); $Text = preg_replace("/\[ol\](.*?)\[\/ol\]/ism", '<ul class="listdecimal" style="list-style-type: decimal;">$1</ul>', $Text); + $Text = preg_replace("/\[\/li\]<br \/>\[li\]/ism",'[/li][li]',$Text); $Text = preg_replace("/\[li\](.*?)\[\/li\]/ism", '<li>$1</li>', $Text); // [dl] tags have an optional [dl terms="bi"] form where bold/italic/underline/mono/large |