hypertext: Add support for nested lists

This commit is contained in:
rubenwardy
2023-04-19 19:47:11 +01:00
parent 0a06e41497
commit 2a0545210b
2 changed files with 66 additions and 52 deletions

View File

@@ -75,12 +75,17 @@ def test_bullets():
html = """
<ul>
<li>One</li>
<li>two three</li>
<li>two three<ul><li>sub one</li><li>sub two</li></ul></li>
<li>four</li>
</ul>
"""
expected = "• One\n• two three\n• four\n"
expected = "<img name=blank.png width=16 height=1>• One\n" \
"<img name=blank.png width=16 height=1>• two three\n" \
"<img name=blank.png width=32 height=1>• sub one\n" \
"<img name=blank.png width=32 height=1>• sub two\n\n" \
"<img name=blank.png width=16 height=1>• four\n"
result = html_to_minetest(html)
assert result["body"].strip() == expected.strip()