From 24192ff1eff7df9a46f13349a043507f8fd9034e Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 1 Sep 2016 13:57:45 +0200 Subject: introduce checklist BBcode for checklists --- include/bbcode.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include/bbcode.php') diff --git a/include/bbcode.php b/include/bbcode.php index 9c65afc59..bc543ca48 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -768,13 +768,14 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $cache = false) } // Check for list text $Text = str_replace("[*]", "
  • ", $Text); - $Text = str_replace("[]", "
  • ", $Text); - $Text = str_replace("[x]", "
  • ", $Text); + $Text = str_replace("[]", "
  • ", $Text); + $Text = str_replace("[x]", "
  • ", $Text); // handle nested lists $endlessloop = 0; while ((((strpos($Text, "[/list]") !== false) && (strpos($Text, "[list") !== false)) || + ((strpos($Text, "[/checklist]") !== false) && (strpos($Text, "[checklist]") !== false)) || ((strpos($Text, "[/ol]") !== false) && (strpos($Text, "[ol]") !== false)) || ((strpos($Text, "[/ul]") !== false) && (strpos($Text, "[ul]") !== false)) || ((strpos($Text, "[/dl]") !== false) && (strpos($Text, "[dl") !== false)) || @@ -786,6 +787,7 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $cache = false) $Text = preg_replace("/\[list=((?-i)I)\](.*?)\[\/list\]/ism", '', $Text); $Text = preg_replace("/\[list=((?-i)a)\](.*?)\[\/list\]/ism", '', $Text); $Text = preg_replace("/\[list=((?-i)A)\](.*?)\[\/list\]/ism", '', $Text); + $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", '
  • $1
  • ', $Text); -- cgit v1.2.3