CssToInlineStyles icon indicating copy to clipboard operation
CssToInlineStyles copied to clipboard

Keep html entities like `é` and `€` escaped

Open jeroenvdheuvel opened this issue 8 years ago • 6 comments

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.

jeroenvdheuvel avatar May 09 '16 16:05 jeroenvdheuvel

@tijsverkoyen merge conflict is resolved

jeroenvdheuvel avatar May 10 '16 11:05 jeroenvdheuvel

@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).

jeroenvdheuvel avatar May 19 '16 06:05 jeroenvdheuvel

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 "&#13" 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?!

voku avatar May 20 '16 12:05 voku

I am of the opinion that this should be merged. cc @tijsverkoyen

w3guy avatar Jun 14 '16 11:06 w3guy

@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

voku avatar Jun 29 '16 10:06 voku

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:

techi602 avatar Jul 14 '16 10:07 techi602