There is the following in the code:
|
assert link.attrs["title"] is not None |
Of course someone managed to produce html with links of the form <a title href="example.org">…</a> that trigger this assert. I think better than having the assert would be to replace
|
if "title" in link.attrs: |
with
link_attrs_title = link.attrs.get("title", None)
if link_attrs_title is not None:
N.B.: The same type of pattern fixable in the way can be found on three other occasions:
|
assert attrs["src"] is not None |
|
assert attrs["width"] is not None |
|
assert attrs["height"] is not None |
There is the following in the code:
html2text/html2text/__init__.py
Line 781 in 24aac86
Of course someone managed to produce html with links of the form
<a title href="example.org">…</a>that trigger this assert. I think better than having the assert would be to replacehtml2text/html2text/__init__.py
Line 780 in 24aac86
with
N.B.: The same type of pattern fixable in the way can be found on three other occasions:
html2text/html2text/__init__.py
Line 502 in 24aac86
html2text/html2text/__init__.py
Line 514 in 24aac86
html2text/html2text/__init__.py
Line 517 in 24aac86