tijsverkoyen / CssToInlineStyles

CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very usefull when you're sending emails.
BSD 3-Clause "New" or "Revised" License
5.8k stars 187 forks source link

Implementing last libxml errors #208

Closed jeffreyzant closed 3 years ago

jeffreyzant commented 3 years ago

This PR allows reading the libxml errors from the createDomDocumentFromHtml method as mentioned in #207

stof commented 3 years ago

This makes the class stateful, which makes it much harder to reuse the same instance multiple times.

A better solution might be to report incomplete loading as failures of the inliner with an exception.

jeffreyzant commented 3 years ago

I understand, do you want me to check for the specific error and then throw an exception? Cause I imagine the errors are supressed by default for a reason. Maybe even a better way is just to remove the libxml_use_internal_errors and let the user of the package decide if they want to ignore the errors?