Skip to content

Commit

Permalink
Merge pull request #85 from kamil-gwozdz/fix-typos
Browse files Browse the repository at this point in the history
Fix typos
  • Loading branch information
byroot committed May 22, 2023
2 parents 9994c38 + b1b222c commit 99eddde
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
- Deprecate `EscapeUtils.escape_url` and `EscapeUtils.unescape_url` given that Ruby 2.5 provides an optimized `CGI.escape` and `CGI.unescape` with mostly similar performance.
- Don't patch `URI.escape` and `URI.unescape` if they don't already exist.
- Add `EscapeUtils.escape_html_once` and `EscapeUtils.rb_eu_escape_html_once_as_html_safe` as faster implementations of Rails `escape_once` helper.
- Deprecate `escape_html` and `escape_html_as_html_safe` given that Ruby 2.5 optimized `GCI.escapeHTML` to be twice faster than the `EscapeUtils` implementation.
- Deprecate `unescape_html` given that Ruby 2.5 optimized `GCI.unescapeHTML` to be only 40% slower than th `EscapeUtils` implementation.
- Deprecate `escape_html` and `escape_html_as_html_safe` given that Ruby 2.5 optimized `CGI.escapeHTML` to be twice faster than the `EscapeUtils` implementation.
- Deprecate `unescape_html` given that Ruby 2.5 optimized `CGI.unescapeHTML` to be only 40% slower than th `EscapeUtils` implementation.
- Deprecate `escape_html_as_html_safe` as well.
- Deprecate `EscapeUtils.html_safe`, there's no reason to escape for slashes `/` in 2022.

Expand Down
6 changes: 3 additions & 3 deletions lib/escape_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ def self.escape_html_once_as_html_safe(html)
end

def self.escape_html(html, secure = false)
warn "EscapeUtils.escape_html is deprecated. Use GCI.escapeHTML instead, it's faster"
warn "EscapeUtils.escape_html is deprecated. Use CGI.escapeHTML instead, it's faster"
CGI.escapeHTML(html)
end

def self.escape_html_as_html_safe(html)
warn "EscapeUtils.escape_html_as_html_safe is deprecated. Use GCI.escapeHTML(str).html_safe instead, it's faster"
warn "EscapeUtils.escape_html_as_html_safe is deprecated. Use CGI.escapeHTML(str).html_safe instead, it's faster"

escaped = CGI.escapeHTML(html)
if String == @html_safe_string_class
Expand All @@ -58,7 +58,7 @@ def self.escape_html_as_html_safe(html)
end

def self.unescape_html(html)
warn "EscapeUtils.unescape_html is deprecated. Use GCI.unescapeHTML instead, performance is similar"
warn "EscapeUtils.unescape_html is deprecated. Use CGI.unescapeHTML instead, performance is similar"
CGI.unescapeHTML(html)
end

Expand Down

0 comments on commit 99eddde

Please sign in to comment.