Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing <img> element closing? #28

Open
sgarbesi opened this issue Nov 23, 2015 · 7 comments
Open

Changing <img> element closing? #28

sgarbesi opened this issue Nov 23, 2015 · 7 comments

Comments

@sgarbesi
Copy link

This plugin converts this:

<img src="..." />

To This:

<img src="...">

This is invalid markup, and while I'm sure many of the new browsers/renderers will not have a problem with this, I fear that the legacy browsers/renderers (Microsoft Outlook cough) will.

@jonkemp
Copy link
Owner

jonkemp commented Nov 23, 2015

This is valid in HTML5.

@sgarbesi
Copy link
Author

@jonkemp It's going to cause problems with the old renderers which I believe this plugin is geared towards? I'm sure in newer HTML renderers one can simply use a stylesheet via the link tag and not need to bother with inline styles. Defeats the purpose?

@jonkemp
Copy link
Owner

jonkemp commented Nov 23, 2015

This module uses inline-css which uses cheerio, rather than juice which used jsdom. Apparently juice has an option to support closing tags now. Cheerio uses htmlparser2 which looks like it has an option to support this.

https://github.com/fb55/htmlparser2/wiki/Parser-options

I don't have plans to at this time though. I've had only a few requests for this. I would be interested in pull requests. Otherwise this could be something to look at doing at some point. I'll mark it as a feature request. Thanks.

@sgarbesi
Copy link
Author

cheeriojs/cheerio#378

@sgarbesi
Copy link
Author

@jonkemp If I change L164 in inline-css.js to .xml() it fixes it.

@sgarbesi
Copy link
Author

@jonkemp I submitted a PR.

@drKnoxy
Copy link

drKnoxy commented Mar 24, 2016

well this was surprising

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants