Self-closing html tags get change
Opened this issue · 2 comments
Hi there,
We're using Apache Wicket for sending our emails and using inline-css as a gulp task to inline the styling. We we are running into some issues where the task is not handling self-closing tags very well.
<base wicket:id="base" />
becomes <base wicket:id="base">
And then <wicket:child />
becomes:
<wicket:child></wicket:child>
Is it possible that the task does not handle self-closing tags correctly?
Thanks :)
@lucastobrazil inline-css uses cheerio to do the html parsing, and cheerio uses another module called htmlparser2. If the issue is the XML being mangled then I would look there. htmlparser2 says it can handle XML.
https://github.com/cheeriojs/cheerio
https://github.com/fb55/htmlparser2/
There's a set of options that gets passed to cheerio from inline-css. I believe xmlmode is set to false. You can try overriding that in the options and see if that fixes it.
@jonkemp oh awesome, thanks! Will look into it and report back :)