diff options
author | Abinoam P. Marques Jr <abinoam@gmail.com> | 2012-02-12 17:10:06 -0800 |
---|---|---|
committer | Abinoam P. Marques Jr <abinoam@gmail.com> | 2012-02-12 17:10:06 -0800 |
commit | e575a3a02c324d65e6849ffd3f8cf68e7318f748 (patch) | |
tree | 9048628c9822397661caa504705a34e48c20c8ce | |
parent | 10e66d293df695e37be05200ab130f1fc988880b (diff) | |
download | volse-hubzilla-e575a3a02c324d65e6849ffd3f8cf68e7318f748.tar.gz volse-hubzilla-e575a3a02c324d65e6849ffd3f8cf68e7318f748.tar.bz2 volse-hubzilla-e575a3a02c324d65e6849ffd3f8cf68e7318f748.zip |
Fixed bbcode [li] and [*] handling.
-rwxr-xr-x | include/bbcode.php | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/include/bbcode.php b/include/bbcode.php index 5eacb256b..1d11f687d 100755 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -146,12 +146,8 @@ function bbcode($Text,$preserve_nl = false) { $Text = preg_replace("(\[center\](.*?)\[\/center\])ism","<div style=\"text-align:center;\">$1</div>",$Text); // Check for list text - - if(stristr($Text,'[/(list|ul|ol)]')) - $Text = str_replace("[*]", "<li>", $Text); - - if(stristr($Text,'[/list]')) - $Text = str_replace("[*]", "<li>", $Text); + $Text = str_replace("[*]", "<li>", $Text); + $Text = preg_replace("/\[li\](.*?)\[\/li\]/ism", '<li>$1</li>' ,$Text); $Text = preg_replace("/\[list\](.*?)\[\/list\]/ism", '<ul class="listbullet" style="list-style-type: circle;">$1</ul>' ,$Text); $Text = preg_replace("/\[ul\](.*?)\[\/ul\]/ism", '<ul class="listbullet" style="list-style-type: circle;">$1</ul>' @@ -168,7 +164,6 @@ upper-roman;">$2</ul>' ,$Text); lower-alpha;">$2</ul>' ,$Text); $Text = preg_replace("/\[list=((?-i)A)\](.*?)\[\/list\]/ism", '<ul class="listupperalpha" style="list-style-type: upper-alpha;">$2</ul>' ,$Text); - $Text = preg_replace("/\[li\](.*?)\[\/li\]/sm", '<li>$1</li>' ,$Text); $Text = preg_replace("/\[td\](.*?)\[\/td\]/sm", '<td>$1</td>' ,$Text); $Text = preg_replace("/\[tr\](.*?)\[\/tr\]/sm", '<tr>$1</tr>' ,$Text); |