Deprecate use of [*] BBCode tag for list items in favor of [li]

- It is conflicting with Markdown syntax
This commit is contained in:
Hypolite Petovan 2024-02-09 20:33:42 -05:00
parent ede41166ae
commit 5b5c9ddc74
6 changed files with 46 additions and 45 deletions

View file

@ -1549,9 +1549,6 @@ class BBCode
// Check for centered text
$text = preg_replace("(\[center\](.*?)\[\/center\])ism", '<div style="text-align:center;">$1</div>', $text);
// Check for list text
$text = str_replace("[*]", "<li>", $text);
// Check for block-level custom CSS
$text = preg_replace('#(?<=^|\n)\[style=(.*?)](.*?)\[/style](?:\n|$)#ism', '<div style="$1">$2</div>', $text);
@ -1591,6 +1588,10 @@ class BBCode
$text = preg_replace("/\[li\](.*?)\[\/li\]/ism", '<li>$1</li>', $text);
}
// Check for list text
$text = str_replace("[*]", "<li>", $text);
$text = str_replace("[li]", "<li>", $text);
$text = preg_replace("/\[th\](.*?)\[\/th\]/sm", '<th>$1</th>', $text);
$text = preg_replace("/\[td\](.*?)\[\/td\]/sm", '<td>$1</td>', $text);
$text = preg_replace("/\[tr\](.*?)\[\/tr\]/sm", '<tr>$1</tr>', $text);