We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f74833c commit 5c10f56Copy full SHA for 5c10f56
1 file changed
lib/erb/util.rb
@@ -1,3 +1,9 @@
1
+begin
2
+ # ERB::Util.html_escape
3
+ require 'erb/escape'
4
+rescue LoadError # JRuby can't load .so
5
+end
6
+
7
#--
8
# ERB::Util
9
#
@@ -15,10 +21,7 @@ module ERB::Util
15
21
16
22
# is a > 0 & a < 10?
17
23
18
- begin
19
- # ERB::Util.html_escape
20
- require 'erb/escape'
- rescue LoadError
24
+ unless method_defined?(:html_escape) # for JRuby
25
def html_escape(s)
26
CGI.escapeHTML(s.to_s)
27
end
0 commit comments