CssToInlineStyles
CssToInlineStyles copied to clipboard
Keep html entities like `é` and `€` escaped
Keep the escaped html entities as is. Instead of changing them to their ISO 8859-1 or UTF-8 counterparts é
and €
.
Html entities should not be touched, since not all everybody understands UTF-8 characters. By not escaping them, the user of this library stays in control.
@tijsverkoyen merge conflict is resolved
@tijsverkoyen could you provide comment on this issue? I'm fine with changing it if needed. When you don't like to merge it (because you don't like to feature) is okay too (but unfortunate for me).
I have a small problem with this change ...
1.) if we have a html-template with "\r" (Mac) carriage return 2.) the xml-parser will convert it into "
" 3.) we convert it into "!AMP!#13"
... as a hack I replaced this chars, but I don't know if there are more magic from the xml-parser that isn't covert by our unit-tests?!
I am of the opinion that this should be merged. cc @tijsverkoyen
@jeroenvdheuvel I moved this logic into "https://github.com/voku/simple_html_dom", so now the Dom-Parser is separated from the CssToInline class. It looks much more cleaner and we have some extra unit-tests in the "simple_html_dom"-repository. What do you think?
-> https://github.com/voku/CssToInlineStyles/commit/b0da918419fd1d1d9a81d7bfd72d0cdb23d1d667
I guess the issue could be solved with html_entity_decode() to decode DomDocument::saveHtml() output Since some e-mail clients such as thunderbird or android have issues with displaying entities. Well they truly display the entities in their hex format which is not suitable for many people :smile: