mirror of
https://github.com/friendica/friendica
synced 2025-04-22 05:10:10 +00:00
Rework new lines around list BBCode
- Remove blanket new lines remover in HTML::toBBCode - Add test to ensure the commutativity of the markups
This commit is contained in:
parent
200bdb55ba
commit
1ce438e964
3 changed files with 30 additions and 31 deletions
|
@ -281,9 +281,9 @@ class HTML
|
|||
self::tagToBBCode($doc, 'div', [], "\r", "\r");
|
||||
self::tagToBBCode($doc, 'p', [], "\n", "\n");
|
||||
|
||||
self::tagToBBCode($doc, 'ul', [], "[ul]", "[/ul]");
|
||||
self::tagToBBCode($doc, 'ol', [], "[ol]", "[/ol]");
|
||||
self::tagToBBCode($doc, 'li', [], "[*]", "");
|
||||
self::tagToBBCode($doc, 'ul', [], "[ul]", "\n[/ul]");
|
||||
self::tagToBBCode($doc, 'ol', [], "[ol]", "\n[/ol]");
|
||||
self::tagToBBCode($doc, 'li', [], "\n[*]", "");
|
||||
|
||||
self::tagToBBCode($doc, 'hr', [], "[hr]", "");
|
||||
|
||||
|
@ -349,33 +349,6 @@ class HTML
|
|||
$message = str_replace("\n\n\n", "\n\n", $message);
|
||||
} while ($oldmessage != $message);
|
||||
|
||||
do {
|
||||
$oldmessage = $message;
|
||||
$message = str_replace(
|
||||
[
|
||||
"[/size]\n\n",
|
||||
"\n[hr]",
|
||||
"[hr]\n",
|
||||
"\n[list",
|
||||
"[/list]\n",
|
||||
"\n[/",
|
||||
"[list]\n",
|
||||
"[list=1]\n",
|
||||
"\n[*]"],
|
||||
[
|
||||
"[/size]\n",
|
||||
"[hr]",
|
||||
"[hr]",
|
||||
"[list",
|
||||
"[/list]",
|
||||
"[/",
|
||||
"[list]",
|
||||
"[list=1]",
|
||||
"[*]"],
|
||||
$message
|
||||
);
|
||||
} while ($message != $oldmessage);
|
||||
|
||||
$message = str_replace(
|
||||
['[b][b]', '[/b][/b]', '[i][i]', '[/i][/i]'],
|
||||
['[b]', '[/b]', '[i]', '[/i]'],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue