Sha256: 0acad29313364b50bac1d38aea37f2ce104263329caf4e6489bb4dc1ac6243fb

Contents?: true

Size: 358 Bytes

Versions: 4

Compression:

Stored size: 358 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.1.8 lib/escape_utils/html_safety.rb
escape_utils-0.1.7 lib/escape_utils/html_safety.rb
escape_utils-0.1.6 lib/escape_utils/html_safety.rb
escape_utils-0.1.5 lib/escape_utils/html_safety.rb