diff options
author | Mario <mario@mariovavti.com> | 2024-03-24 17:50:27 +0100 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2024-03-24 17:50:27 +0100 |
commit | 3c0d6339bb12bd7fbf65ba7a79078e39737b4387 (patch) | |
tree | 5784ae0922499f689c123d2341ca57b12a382285 /tests/unit/includes/BBCodeTest.php | |
parent | a0cfe22501dc9daa7dd8cff86803cf494a1f5ec3 (diff) | |
download | volse-hubzilla-3c0d6339bb12bd7fbf65ba7a79078e39737b4387.tar.gz volse-hubzilla-3c0d6339bb12bd7fbf65ba7a79078e39737b4387.tar.bz2 volse-hubzilla-3c0d6339bb12bd7fbf65ba7a79078e39737b4387.zip |
make sure we preserve linefeeds in the actual content of lists and tables also add tests
Diffstat (limited to 'tests/unit/includes/BBCodeTest.php')
-rw-r--r-- | tests/unit/includes/BBCodeTest.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/unit/includes/BBCodeTest.php b/tests/unit/includes/BBCodeTest.php index fedd2df06..a6c798992 100644 --- a/tests/unit/includes/BBCodeTest.php +++ b/tests/unit/includes/BBCodeTest.php @@ -111,13 +111,25 @@ class BBCodeTest extends UnitTestCase { "some text\n[list]\n[*] item1\n[*] item2\n[/list]\nsome more text", 'some text<br /><ul class="listbullet"><li> item1<li> item2</ul>some more text' ], + 'list with linebreaks \n in text' => [ + "some text\n[list]\n[*] item1\nsome text[*] item2\nsome text[/list]\nsome more text", + 'some text<br /><ul class="listbullet"><li> item1<br />some text<li> item2<br />some text</ul>some more text' + ], 'list with linebreaks \r' => [ "some text\r[list]\r[*] item1\r[*] item2\r[/list]\rsome more text", 'some text<br /><ul class="listbullet"><li> item1<li> item2</ul>some more text' ], + 'list with linebreaks \r in text' => [ + "some text\r[list]\r[*] item1\rsome text\r[*] item2\rsome text\r[/list]\rsome more text", + 'some text<br /><ul class="listbullet"><li> item1<br />some text<li> item2<br />some text</ul>some more text' + ], 'list with linebreaks \r\n' => [ "some text\r\n[list]\r\n[*] item1\r\n[*] item2\r\n[/list]\r\nsome more text", 'some text<br /><ul class="listbullet"><li> item1<li> item2</ul>some more text' + ], + 'list with linebreaks \r\n in text' => [ + "some text\r\n[list]\r\n[*] item1\r\nsome text[*] item2\r\nsome text[/list]\r\nsome more text", + 'some text<br /><ul class="listbullet"><li> item1<br />some text<li> item2<br />some text</ul>some more text' ] ]; } |