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

XML minifier incorrectly un-escapes numeric entities #362

Closed
picasticks opened this issue Dec 13, 2020 · 0 comments
Closed

XML minifier incorrectly un-escapes numeric entities #362

picasticks opened this issue Dec 13, 2020 · 0 comments

Comments

@picasticks
Copy link

Sorry I don't have a PR for this, but it appears to only affect the XML minifier, not HTML, so you may just want to add a RevEntitiesMap for XML to pass to the parser.

Named entities work fine, only numeric entities are un-escaped.

Quick way to replicate the issue:

$ echo '<title>Test &amp; &lt; &#038; &#60; XML</title>' | minify --mime application/xml
<title>Test &amp; &lt; & < XML</title>

Instead of returning something like:

<title>Test &amp; &lt; &#38; &#60; XML</title>

Or:

<title>Test &amp; &lt; &amp; &lt; XML</title>

For context, this came up for me because Minify broke a WordPress-generated RSS feed. WordPress escapes & with the numeric entity &#038; (including one leading 0). So, that's one data point on how often &#38; is being used instead of &amp;.

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

1 participant