Skip to content

Commit

Permalink
Add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
joouha committed Jan 17, 2024
1 parent 860ec0b commit 41f88f5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/test_html2text.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,3 +236,12 @@ def _skip_certain_tags(h2t, tag, attrs, start):
"some <i>italics</i> too."
)
assert ret == "this is a txt and this is a with text and some _italics_ too.\n\n"


def test_table_empty_first_cell():
h = html2text.HTML2Text()
ret = h.handle(
"<table><tr><th></th><th>b</th></tr>"
"<tr><td>c</td><td>d</td></tr></table>"
).strip().replace(" ", "")
assert ret == "||b\n---|---\nc|d"

0 comments on commit 41f88f5

Please sign in to comment.