Skip to content

Commit

Permalink
Escape ' in Haml::Helpers#escape_once too
Browse files Browse the repository at this point in the history
like Haml::Helpers#html_escape.
  • Loading branch information
k0kubun committed Feb 8, 2017
1 parent 34d9ff1 commit e1dbf81
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/haml/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ def html_escape(text)
text.gsub(HTML_ESCAPE_REGEX, HTML_ESCAPE)
end

HTML_ESCAPE_ONCE_REGEX = /[\"><]|&(?!(?:[a-zA-Z]+|#(?:\d+|[xX][0-9a-fA-F]+));)/
HTML_ESCAPE_ONCE_REGEX = /['"><]|&(?!(?:[a-zA-Z]+|#(?:\d+|[xX][0-9a-fA-F]+));)/

# Escapes HTML entities in `text`, but without escaping an ampersand
# that is already part of an escaped entity.
Expand Down

0 comments on commit e1dbf81

Please sign in to comment.