Skip to content

Commit 4d8ec53

Browse files
committed
test(html): cover distinct inline symbols
1 parent 5f0f1ae commit 4d8ec53

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

‎packages/markitdown/tests/test_html_code.py‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,19 @@ def test_html_code_explicit_language_overrides_class(language: str) -> None:
5656
)
5757

5858

59+
def test_html_inline_symbols_keep_separate_wrappers() -> None:
60+
assert (
61+
HtmlConverter()
62+
.convert_string(
63+
"<p>H<sub>2</sub>O and x<sup>2</sup></p>",
64+
sub_symbol="~",
65+
sup_symbol="<sup>",
66+
)
67+
.markdown
68+
== "H~2~O and x<sup>2</sup>"
69+
)
70+
71+
5972
def test_html_code_invalid_trimming() -> None:
6073
with pytest.raises(ValueError, match="Invalid value for strip_pre: unknown"):
6174
HtmlConverter().convert_string("<pre>one</pre>", strip_pre="unknown")

0 commit comments

Comments
 (0)