-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Element: Avoid double-escaping valid character references #6620
Conversation
4feae11
to
be94c5e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool! 🎉
@@ -219,6 +219,46 @@ const CSS_PROPERTIES_SUPPORTS_UNITLESS = new Set( [ | |||
'zoom', | |||
] ); | |||
|
|||
/** | |||
* Returns a string with ampersands escaped. Note that this is an imperfect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I read 'imperfect' it makes me think that the function is unfinished, when in fact it's intentionally imperfect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I read 'imperfect' it makes me think that the function is unfinished, when in fact it's intentionally imperfect.
Depends how you view it. Technically it could be improved, but as I saw it the only option would be to include a full list of valid named character references, and in weighing the cost in doing so, I thought it to not have a net positive benefit.
Thanks for the review @noisysocks ! I'll plan to merge this sometime after the upcoming 3.0 release. |
It looks like this PR was missed, 3.1 is coming up soon, let's get it in :) |
Thanks @gziolo , I carelessly forgot about the pull request, but fortunately at least included it in the 3.1 milestone so it didn't go overlooked 😄 |
This pull request seeks to improve the element serializer to avoid double ampersand encoding of valid character references.
Testing instructions:
Ensure unit tests pass:
Verify that unexpected double-escaping no longer invalidates blocks: