html2docx
html2docx copied to clipboard
Tweak to handle links without href
Thanks for creating and sharing html2docx, much appreciated.
FYI, I had an issue converting some user generated HTML that included a link without a href, throwing an error
File: "...h2d.py", line 514, in handle_data
self.handle_link(link['href'], data)
KeyError: 'href'
My kludged solution
if link:
if 'href' in link:
self.handle_link(link['href'],data)
Not sure if there are broader implications of this, but it serves my immediate purpose.
Hey @djplaner, thanks for pointing this out. Will look into fixing this for the next release.
had this issue today - is there a chance to fix it?