From 3c0d6339bb12bd7fbf65ba7a79078e39737b4387 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 24 Mar 2024 17:50:27 +0100 Subject: make sure we preserve linefeeds in the actual content of lists and tables also add tests --- tests/unit/includes/BBCodeTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests/unit') 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
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
some more text' + ], 'list with linebreaks \r' => [ "some text\r[list]\r[*] item1\r[*] item2\r[/list]\rsome more text", 'some text
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
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
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
some more text' ] ]; } -- cgit v1.2.3