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 escape_once not working with hex entities or named entities ending with numbers #795

Closed
wants to merge 1 commit into from

Conversation

kainjow
Copy link
Contributor

@kainjow kainjow commented Aug 31, 2016

Fixes #792

@@ -134,6 +134,12 @@ def test_escape

def test_escape_once
assert_equal '&lt;strong&gt;Hulk&lt;/strong&gt;', @filters.escape_once('&lt;strong&gt;Hulk</strong>')
assert_equal '&excl;1&#x00021;2&#33;', @filters.escape_once('&excl;1&#x00021;2&#33;')
assert_equal '&ncy;2&#x0043D;3&#1085;', @filters.escape_once('&ncy;2&#x0043D;3&#1085;')
assert_equal '&frac34;&#x000BE;&#190;', @filters.escape_once('&frac34;&#x000BE;&#190;')
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this filter was originally intended to be equivalent to ActionView::Helpers::TagHelper#escape_once. But this assertion here behaves differently than that. The ActionView one returns "&amp;frac34;&#x000BE;&#190;".

@samdoiron samdoiron deleted the branch Shopify:master September 14, 2023 18:27
@samdoiron samdoiron closed this Sep 14, 2023
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

Successfully merging this pull request may close these issues.

4 participants