onizet / html2openxml

Html2OpenXml is a small .Net library that convert simple or advanced HTML to plain OpenXml components. This program has started in 2009, initially to convert user's comments from SharePoint to Word.
MIT License
297 stars 106 forks source link

keep processing html on image download error #103

Closed albertoantunes closed 2 years ago

albertoantunes commented 3 years ago

Hi, first thanks a lot for this library!

We've been using it for a while, and today got a bug that, after investigation, turned out to be due to an image that is not hosted anymore and that takes a while to resolve in a timeout error.

The way the lib is currently handling Image downloads, if any download fail then the error cascades all the way and an empty docx is generated.

In our case we found that it is desirable to fail gracefully and still generate the docx without the missing image, and just log the error for further analysis.

It would be great if we could get this merged, or if you have other suggestions please let me know!

Thanks!