vanng822/go-premailer

font-family escaping

pierre-b opened this issue · 5 comments

Hello guys,

When I check the generated HTML for classes that contain a font-family the output is:

<p class="font-family:&#39;Arial&#39;, sans-serif"></p>

Is this the expected behavior? I'm suprised to see HTML entities &#39; in the middle of a CSS attribute...

Thanks

Hi @pierre-b

Unfortunately I don't have any development computer anymore so I can't take a look but I think most likely somewhere in html.Nodes that escape the value of attribute.

So for now if possible don't use quotes (I think it is possible for your example but maybe you have other things that need quotes)

Or maybe goquery that use html.Render
https://github.com/PuerkitoBio/goquery/blob/master/property.go#L104

But could also be from css-package.

Hi @vanng822 thanks for the update, removing the quotes on standard fonts works (Arial etc...).