File tree Expand file tree Collapse file tree 3 files changed +12
-10
lines changed
Expand file tree Collapse file tree 3 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -65,9 +65,12 @@ optimized_escape_html(VALUE str)
6565 return escaped ;
6666}
6767
68- // ERB::Util.html_escape is different from CGI.escapeHTML in the following two parts:
69- // * ERB::Util.html_escape converts an argument with #to_s first (only if it's not T_STRING)
70- // * ERB::Util.html_escape does not allocate a new string when nothing needs to be escaped
68+ /*
69+ * ERB::Util.html_escape is similar to CGI.escapeHTML but different in the following two parts:
70+ *
71+ * * ERB::Util.html_escape converts an argument with #to_s first (only if it's not T_STRING)
72+ * * ERB::Util.html_escape does not allocate a new string when nothing needs to be escaped
73+ */
7174static VALUE
7275erb_escape_html (VALUE self , VALUE str )
7376{
Original file line number Diff line number Diff line change 11# frozen_string_literal: true
2- #--
2+
33# ERB::DefMethod
44#
55# Utility module to define eRuby script as instance method.
Original file line number Diff line number Diff line change 11# frozen_string_literal: true
2- #--
3- # ERB::Escape
4- #
5- # A subset of ERB::Util. Unlike ERB::Util#html_escape, we expect/hope
6- # Rails will not monkey-patch ERB::Escape#html_escape.
2+
73begin
84 # We don't build the C extension for JRuby, TruffleRuby, and WASM
95 if $LOAD_PATH. resolve_feature_path ( 'erb/escape' )
128rescue LoadError # resolve_feature_path raises LoadError on TruffleRuby 22.3.0
139end
1410unless defined? ( ERB ::Escape )
11+ # ERB::Escape
12+ #
13+ # A subset of ERB::Util. Unlike ERB::Util#html_escape, we expect/hope
14+ # Rails will not monkey-patch ERB::Escape#html_escape.
1515 module ERB ::Escape
1616 def html_escape ( s )
1717 CGI . escapeHTML ( s . to_s )
@@ -20,7 +20,6 @@ def html_escape(s)
2020 end
2121end
2222
23- #--
2423# ERB::Util
2524#
2625# A utility module for conversion routines, often handy in HTML generation.
You can’t perform that action at this time.
0 commit comments