Sha256: da626d78e54969594dd8760ae525623c84933aace16ff2ac1e5b7bbf4eb3870a

Contents?: true

Size: 355 Bytes

Versions: 11

Compression:

Stored size: 355 Bytes

Contents

require 'sinatra/base'

module Sinatra
  module Helpers
    module Html
      module Escape
        def h(text)
          Rack::Utils.escape_html(text)
        end

        def h!(text, blank_text = ' ')
          return blank_text if text.nil? || text.empty?
          h text
        end
      end
    end
  end

  helpers Helpers::Html::Escape
end

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
sbfaulkner-sinatra-helpers-0.9.1 lib/sinatra-helpers/html/escape.rb
tdreyno-middleman-0.2.8 vendor/sinatra-helpers/lib/sinatra-helpers/html/escape.rb
tdreyno-middleman-0.2.9 vendor/sinatra-helpers/lib/sinatra-helpers/html/escape.rb
tdreyno-middleman-0.3.0 vendor/sinatra-helpers/lib/sinatra-helpers/html/escape.rb
tdreyno-middleman-0.3.1 vendor/sinatra-helpers/lib/sinatra-helpers/html/escape.rb
middleman-0.3.6 vendor/sinatra-helpers/lib/sinatra-helpers/html/escape.rb
middleman-0.3.5 vendor/sinatra-helpers/lib/sinatra-helpers/html/escape.rb
middleman-0.2.8 vendor/sinatra-helpers/lib/sinatra-helpers/html/escape.rb
middleman-0.2.9 vendor/sinatra-helpers/lib/sinatra-helpers/html/escape.rb
middleman-0.3.0 vendor/sinatra-helpers/lib/sinatra-helpers/html/escape.rb
middleman-0.3.1 vendor/sinatra-helpers/lib/sinatra-helpers/html/escape.rb