Sha256: 3a1e91dd73e5d02fd09c4d8dfd56495033ee3a852dd4f97c07f3e46db4c87626

Contents?: true

Size: 359 Bytes

Versions: 4

Compression:

Stored size: 359 Bytes

Contents

# encoding: utf-8

module EscapeUtils
  module HtmlSafety
    if "".respond_to? :html_safe?
      def _escape_html(s)
        if s.html_safe?
          s.to_s.html_safe
        else
          EscapeUtils.escape_html(s.to_s).html_safe
        end
      end
    else
      def _escape_html(s)
        EscapeUtils.escape_html(s.to_s)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
escape_utils-0.2.3 lib/escape_utils/html_safety.rb
escape_utils-0.2.2 lib/escape_utils/html_safety.rb
escape_utils-0.2.1 lib/escape_utils/html_safety.rb
escape_utils-0.2.0 lib/escape_utils/html_safety.rb