File tree Expand file tree Collapse file tree 6 files changed +22
-10
lines changed Expand file tree Collapse file tree 6 files changed +22
-10
lines changed Original file line number Diff line number Diff line change
1
+ LICENSE.txt
2
+ NEWS.md
3
+ README.md
4
+ ext/
5
+ lib/
6
+ _doc/
Original file line number Diff line number Diff line change
1
+ main_page: README.md
Original file line number Diff line number Diff line change
1
+ # See {CGI document}[https://docs.ruby-lang.org/en/master/CGI.html]
2
+ module CGI
3
+ end
Original file line number Diff line number Diff line change @@ -65,9 +65,12 @@ optimized_escape_html(VALUE str)
65
65
return escaped ;
66
66
}
67
67
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
+ */
71
74
static VALUE
72
75
erb_escape_html (VALUE self , VALUE str )
73
76
{
Original file line number Diff line number Diff line change 1
1
# frozen_string_literal: true
2
- #--
2
+
3
3
# ERB::DefMethod
4
4
#
5
5
# Utility module to define eRuby script as instance method.
Original file line number Diff line number Diff line change 1
1
# 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
+
7
3
begin
8
4
# We don't build the C extension for JRuby, TruffleRuby, and WASM
9
5
if $LOAD_PATH. resolve_feature_path ( 'erb/escape' )
12
8
rescue LoadError # resolve_feature_path raises LoadError on TruffleRuby 22.3.0
13
9
end
14
10
unless 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.
15
15
module ERB ::Escape
16
16
def html_escape ( s )
17
17
CGI . escapeHTML ( s . to_s )
@@ -20,7 +20,6 @@ def html_escape(s)
20
20
end
21
21
end
22
22
23
- #--
24
23
# ERB::Util
25
24
#
26
25
# A utility module for conversion routines, often handy in HTML generation.
You can’t perform that action at this time.
0 commit comments