Sha256: b3d7760c8f337bd9472d271293414fd6f648f38b749fe71b42f3cdb7c433123f

Contents?: true

Size: 373 Bytes

Versions: 76

Compression:

Stored size: 373 Bytes

Contents

# frozen_string_literal: true
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

76 entries across 76 versions & 1 rubygems

Version Path
hamlit-2.14.6 lib/hamlit/helpers.rb
hamlit-2.14.6-java lib/hamlit/helpers.rb
hamlit-2.14.5-java lib/hamlit/helpers.rb
hamlit-2.14.5 lib/hamlit/helpers.rb
hamlit-2.14.4 lib/hamlit/helpers.rb
hamlit-2.14.4-java lib/hamlit/helpers.rb
hamlit-2.14.3-java lib/hamlit/helpers.rb
hamlit-2.14.3 lib/hamlit/helpers.rb
hamlit-2.14.2-java lib/hamlit/helpers.rb
hamlit-2.14.2 lib/hamlit/helpers.rb
hamlit-2.14.0 lib/hamlit/helpers.rb
hamlit-2.14.0-java lib/hamlit/helpers.rb
hamlit-2.14.1-java lib/hamlit/helpers.rb
hamlit-2.14.1 lib/hamlit/helpers.rb
hamlit-2.13.2-java lib/hamlit/helpers.rb
hamlit-2.13.2 lib/hamlit/helpers.rb
hamlit-2.13.1-java lib/hamlit/helpers.rb
hamlit-2.13.1 lib/hamlit/helpers.rb
hamlit-2.13.0-java lib/hamlit/helpers.rb
hamlit-2.13.0 lib/hamlit/helpers.rb