aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/html2bbcode.php3
-rw-r--r--tests/unit/includes/BBCodeTest.php8
2 files changed, 9 insertions, 2 deletions
diff --git a/include/html2bbcode.php b/include/html2bbcode.php
index 03e09cd62..b7f3ea4e3 100644
--- a/include/html2bbcode.php
+++ b/include/html2bbcode.php
@@ -205,10 +205,9 @@ function html2bbcode($message)
node2bbcode($doc, 'audio', array('src'=>'/(.+)/'), '[audio]$1', '[/audio]');
// node2bbcode($doc, 'iframe', array('src'=>'/(.+)/'), '[iframe]$1', '[/iframe]');
-
+ node2bbcode($doc, 'li', array(), "[*]", "");
node2bbcode($doc, 'ul', array(), "[list]", "[/list]");
node2bbcode($doc, 'ol', array(), "[list=1]", "[/list]");
- node2bbcode($doc, 'li', array(), "[*]", "");
node2bbcode($doc, 'hr', array(), "[hr]", "");
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]'
]
];
}