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

HTML entities are being converted unexpectedly #51

Closed
cossssmin opened this issue Oct 29, 2020 · 6 comments
Closed

HTML entities are being converted unexpectedly #51

cossssmin opened this issue Oct 29, 2020 · 6 comments

Comments

@cossssmin
Copy link
Member

I've noticed that, starting with 0.5.1, HTML entities are being converted.

This is unexpected and in my case (Maizzle) breaks HTML emails.

For example, this:

<p>&copy; 2020</p>

... is output as:

<p>© 2020</p>

Here's another example:

<div>&zwnj;</div>

<div>&nbsp;</div>

... results in:

<div></div>

<div> </div>

These should stay as they are and should not be converted. Is there something users can do about it, or must it be handled in core?

@cossssmin
Copy link
Member Author

cossssmin commented Oct 29, 2020

Here's the result of using these in the parser.js test from PostHTML:

image

@Scrum
Copy link
Member

Scrum commented Oct 29, 2020

related to fb55/htmlparser2#630

@cossssmin
Copy link
Member Author

Found the breaking change in fb55/htmlparser2@8ac01e0, decodeEntities is now true by default - disabling it works as before.

@Scrum
Copy link
Member

Scrum commented Oct 29, 2020

Strange, but the documents say that by default false https://github.com/fb55/htmlparser2/wiki/Parser-options#option-decodeentities

@cossssmin
Copy link
Member Author

Yes, they probably forgot to update it 🤷‍♂️

@fb55
Copy link

fb55 commented Oct 29, 2020

Yes, they probably forgot to update it 🤷‍♂️

That's spot on, thanks for flagging :)

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

No branches or pull requests

3 participants