Sha256: a0e4b301024fea67162b1c7a70e4195fa81e789a9b616ce639deb2870e5c9592

Contents?: true

Size: 343 Bytes

Versions: 6

Compression:

Stored size: 343 Bytes

Contents

module Hamlit
  module Helpers
    extend self

    # The same as original Haml::Helpers#preserve without block support.
    def preserve(input)
      # https://github.com/haml/haml/blob/4.1.0.beta.1/lib/haml/helpers.rb#L130-L133
      s = input.to_s.chomp("\n")
      s.gsub!(/\n/, '
')
      s.delete!("\r")
      s
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
hamlit-2.6.1 lib/hamlit/helpers.rb
hamlit-2.6.0 lib/hamlit/helpers.rb
hamlit-2.5.0 lib/hamlit/helpers.rb
hamlit-2.4.2 lib/hamlit/helpers.rb
hamlit-2.4.1 lib/hamlit/helpers.rb
hamlit-2.4.0 lib/hamlit/helpers.rb