Module: WEBrick::HTMLUtils
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/webrick-1.7.0/lib/webrick/htmlutils.rb
Class Method Summary collapse
-
.escape(string) ⇒ Object
Escapes &, “, > and < in
string
.
Class Method Details
.escape(string) ⇒ Object
Escapes &, “, > and < in string
18 19 20 21 22 23 24 25 26 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/webrick-1.7.0/lib/webrick/htmlutils.rb', line 18 def escape(string) return "" unless string str = string.b str.gsub!(/&/n, '&') str.gsub!(/\"/n, '"') str.gsub!(/>/n, '>') str.gsub!(/</n, '<') str.force_encoding(string.encoding) end |