diff options
author | friendica <info@friendica.com> | 2012-07-05 16:03:29 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-07-05 16:03:29 -0700 |
commit | fe984963ed5d5411cd7e7d169ad24bf4ab2e5419 (patch) | |
tree | 4602367c8a7c71eaf03c585016743b806b123a18 /include/bbcode.php | |
parent | 10336651ba12db4e62737c1fbd6d63680217ff38 (diff) | |
parent | 041aeaf4a159e277b828d8a386c0968657afb723 (diff) | |
download | volse-hubzilla-fe984963ed5d5411cd7e7d169ad24bf4ab2e5419.tar.gz volse-hubzilla-fe984963ed5d5411cd7e7d169ad24bf4ab2e5419.tar.bz2 volse-hubzilla-fe984963ed5d5411cd7e7d169ad24bf4ab2e5419.zip |
Merge pull request #373 from fermionic/more-list-fixes
fix small bug in lists and revert Diaspora list processing to non-Markdo...
Diffstat (limited to 'include/bbcode.php')
-rw-r--r-- | include/bbcode.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/bbcode.php b/include/bbcode.php index cb4a0bc6f..55a879497 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -166,14 +166,14 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) { // Check for list text $Text = str_replace("[*]", "<li>", $Text); - $Text = preg_replace("/\[li\](.*?)\[\/li\]/ism", '<li>$1</li>' ,$Text); // handle nested lists $endlessloop = 0; while ((((strpos($Text, "[/list]") !== false) && (strpos($Text, "[list") !== false)) || ((strpos($Text, "[/ol]") !== false) && (strpos($Text, "[ol]") !== false)) || - ((strpos($Text, "[/ul]") !== false) && (strpos($Text, "[ul]") !== false))) && (++$endlessloop < 20)) { + ((strpos($Text, "[/ul]") !== false) && (strpos($Text, "[ul]") !== false)) || + ((strpos($Text, "[/li]") !== false) && (strpos($Text, "[li]") !== false))) && (++$endlessloop < 20)) { $Text = preg_replace("/\[list\](.*?)\[\/list\]/ism", '<ul class="listbullet" style="list-style-type: circle;">$1</ul>' ,$Text); $Text = preg_replace("/\[list=\](.*?)\[\/list\]/ism", '<ul class="listnone" style="list-style-type: none;">$1</ul>' ,$Text); $Text = preg_replace("/\[list=1\](.*?)\[\/list\]/ism", '<ul class="listdecimal" style="list-style-type: decimal;">$1</ul>' ,$Text); @@ -183,6 +183,7 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) { $Text = preg_replace("/\[list=((?-i)A)\](.*?)\[\/list\]/ism", '<ul class="listupperalpha" style="list-style-type: upper-alpha;">$2</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\](.*?)\[\/li\]/ism", '<li>$1</li>' ,$Text); } $Text = preg_replace("/\[th\](.*?)\[\/th\]/sm", '<th>$1</th>' ,$Text); |