privateOmega / html-to-docx

HTML to DOCX converter
MIT License
375 stars 141 forks source link

Fix the failure to export docx when the image path is not http. #154

Closed cweijan closed 1 year ago

cweijan commented 1 year ago

I use your library to convert html to docx, it's great, but it's a little bad for image processing, this request does the following:

  1. Support importing local images through file:/// schema
  2. Prevent the exception that occurs when trying to read the base64 of the image (this causes the entire export process to be interrupted)
jrm0695 commented 1 year ago

Still not working at the moment, I have an error "Cannot read properties of null (reading '2')" at /[html-to-docx]/src/helpers/xml-builder.js:983:46 when trying to parse a HTML having a img tag whose src is base64 data