instance method
escape_once
Ruby on Rails 2.2.3
Since v2.2.3Signature
escape_once(html)
Returns an escaped version of html without affecting existing escaped entities.
Examples
escape_once("1 > 2 & 3") # => "1 < 2 & 3" escape_once("<< Accept & Checkout") # => "<< Accept & Checkout"
Parameters
-
htmlreq
Source
# File actionpack/lib/action_view/helpers/tag_helper.rb, line 106
def escape_once(html)
ActiveSupport::Multibyte.clean(html.to_s).gsub(/[\"><]|&(?!([a-zA-Z]+|(#\d+));)/) { |special| ERB::Util::HTML_ESCAPE[special] }
end
Defined in actionpack/lib/action_view/helpers/tag_helper.rb line 106
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionView::Helpers::TagHelper