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-3.0.3-java lib/hamlit/helpers.rb
hamlit-3.0.3 lib/hamlit/helpers.rb
hamlit-3.0.2-java lib/hamlit/helpers.rb
hamlit-3.0.2 lib/hamlit/helpers.rb
hamlit-3.0.1-java lib/hamlit/helpers.rb
hamlit-3.0.1 lib/hamlit/helpers.rb
hamlit-3.0.0-java lib/hamlit/helpers.rb
hamlit-3.0.0 lib/hamlit/helpers.rb
hamlit-2.16.2-java lib/hamlit/helpers.rb
hamlit-2.16.2 lib/hamlit/helpers.rb
hamlit-2.16.1-java lib/hamlit/helpers.rb
hamlit-2.16.1 lib/hamlit/helpers.rb
hamlit-2.16.0-java lib/hamlit/helpers.rb
hamlit-2.16.0 lib/hamlit/helpers.rb
hamlit-2.15.2-java lib/hamlit/helpers.rb
hamlit-2.15.2 lib/hamlit/helpers.rb
hamlit-2.15.1-java lib/hamlit/helpers.rb
hamlit-2.15.1 lib/hamlit/helpers.rb
hamlit-2.15.0-java lib/hamlit/helpers.rb
hamlit-2.15.0 lib/hamlit/helpers.rb