aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2024-05-03 09:39:58 +0200
committerMario <mario@mariovavti.com>2024-05-03 09:39:58 +0200
commitb25662e183fa800d13908e707e0a3f33131b9ea8 (patch)
tree172c0b039e50c7f531a75c132c90bb97b0c81a79 /tests/unit
parent47a86f877172fe6cdc44991c0722550e4190cb95 (diff)
downloadvolse-hubzilla-b25662e183fa800d13908e707e0a3f33131b9ea8.tar.gz
volse-hubzilla-b25662e183fa800d13908e707e0a3f33131b9ea8.tar.bz2
volse-hubzilla-b25662e183fa800d13908e707e0a3f33131b9ea8.zip
fix nested lists by parsing li before ul or ol and add a test
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/includes/BBCodeTest.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/unit/includes/BBCodeTest.php b/tests/unit/includes/BBCodeTest.php
index a8aa8ee2b..e1fba9fbc 100644
--- a/tests/unit/includes/BBCodeTest.php
+++ b/tests/unit/includes/BBCodeTest.php
@@ -230,6 +230,14 @@ class BBCodeTest extends UnitTestCase {
'html reshares from streams' => [
'<div><div><a href="https://example.com"><img src="https://example.com/image.jpg" alt="image/photo"></a> shared something</div>something</div>',
'[url=https://example.com][img=https://example.com/image.jpg]image/photo[/img][/url] shared something' . "\n" . 'something'
+ ],
+ 'list' => [
+ '<ul><li>list 1</li><li>list 2</li><li>list 3</li></ul>',
+ '[list][*]list 1[*]list 2[*]list 3[/list]'
+ ],
+ 'nested list' => [
+ '<ul><li>list 1</li><li>list 2</li><li>list 3</li><ul><li>list 1</li><li>list 2</li><li>list 3</li></ul></ul>',
+ '[list][*]list 1[*]list 2[*]list 3[list][*]list 1[*]list 2[*]list 3[/list][/list]'
]
];
}