From cfc61a69ef80de70b1e4e29666f8beb4b80406fc Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 12 Oct 2016 15:25:48 -0700 Subject: bbcode: remove the inserted
between list elements due to linefeeds in the textarea. --- include/bbcode.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') 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", "
$1
", $Text); } // Check for list text + + $Text = preg_replace("/
\[\*\]/ism",'[*]',$Text); + $Text = str_replace("[*]", "
  • ", $Text); $Text = str_replace("[]", "
  • ", $Text); $Text = str_replace("[x]", "
  • ", $Text); @@ -807,6 +810,7 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $cache = false) $Text = preg_replace("/\[checklist\](.*?)\[\/checklist\]/ism", '', $Text); $Text = preg_replace("/\[ul\](.*?)\[\/ul\]/ism", '', $Text); $Text = preg_replace("/\[ol\](.*?)\[\/ol\]/ism", '', $Text); + $Text = preg_replace("/\[\/li\]
    \[li\]/ism",'[/li][li]',$Text); $Text = preg_replace("/\[li\](.*?)\[\/li\]/ism", '
  • $1
  • ', $Text); // [dl] tags have an optional [dl terms="bi"] form where bold/italic/underline/mono/large -- cgit v1.2.3