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

Fix double string escape in XML::Node#content= #9300

Merged

Conversation

straight-shoota
Copy link
Member

Libxml2 already escapes special characters in node content, there's no need for the custom escape method. It lead to double escape which turns <foo> content into &amp;lt;foo&amp;&gt;.

The escape method was introduced in #4089 but there's no mention of this escape behaviour in neither the PR nor the linked issue and there have been no specs for this. So I assume it was just wrongly added.

/cc @RX14

Libxml2 already escapes special characters in node content, there's no
need for the custom `escape` method. It lead to double escape which turns
`<foo>` content into `&amp;ltfoo&amp;&gt;`.
Copy link
Contributor

@RX14 RX14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I must have messed up then

@straight-shoota straight-shoota added this to the 0.35.0 milestone May 30, 2020
@RX14 RX14 merged commit a2031af into crystal-lang:master Jun 1, 2020
@straight-shoota straight-shoota deleted the fix/xml-node-content-escape branch June 1, 2020 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants