Merge pull request #13880 from MrPetovan/bug/13878-deprecate-star-list

Deprecate use of [*] BBCode tag for list items in favor of [li]
This commit is contained in:
Michael Vogel 2024-02-11 03:13:28 +01:00 committed by GitHub
commit 2cc8fcc4aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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);

View file

@ -89,7 +89,7 @@ class Tos extends BaseModule
$rules = "[ol]";
foreach (explode("\n", $lines) as $line) {
if (trim($line)) {
$rules .= "\n[*]" . trim($line);
$rules .= "\n[li]" . trim($line);
}
}
$rules .= "\n[/ol]\n";