You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Override ERB::Util#html_escape with Module#prepend
With Ruby 3.2 or the upcoming release of erb.gem, ERB::Util#html_escape
will be faster than CGI.escapeHTML in the case that it escapes nothing
because ERB::Util#html_escape will not duplicate the argument, unlike
CGI.escapeHTML. https://bugs.ruby-lang.org/issues/19102
Calling the original ERB::Util#html_escape with `super` is preferable
not only for the above performance reason but also for making it more
permissive about other monkey patches using Module#prepend. I tried to
use Module#prepend there myself, but I gave it up because it wasn't
compatible with the monkey patch of Rails not using Module#prepend.
0 commit comments