complete coverage of what is there

This commit is contained in:
Chris Caron 2023-10-06 18:11:44 -04:00
parent f725b3ac75
commit 4c1b5cabbe
2 changed files with 6 additions and 1 deletions

View File

@ -308,7 +308,7 @@ class HTMLMarkDownConverter(HTMLConverter):
self._preserver_cr = True
elif tag == 'a':
for name, link in attrs:
for name, link in attrs: # pragma: no branch
if name == 'href':
self._link = '(' + link + ')'
# Take an early exit for speed (in case there are more

View File

@ -107,6 +107,11 @@ def test_conversion_html_to_text():
"<a href='#'>my link</a>") == \
"test my link"
# a with missing href entry
assert to_html("<span></span<<span>test</span> "
"<a>my link</a>") == \
"test my link"
# </p> missing
assert to_html("<body><div>line 1 <b>bold</b></div> "
" <a href='#'>my link</a>"