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.8.10 lib/hamlit/helpers.rb
hamlit-2.8.8 lib/hamlit/helpers.rb
hamlit-2.8.7 lib/hamlit/helpers.rb
hamlit-2.8.6 lib/hamlit/helpers.rb
hamlit-2.8.5 lib/hamlit/helpers.rb
hamlit-2.8.4 lib/hamlit/helpers.rb
hamlit-2.8.3 lib/hamlit/helpers.rb
hamlit-2.8.2 lib/hamlit/helpers.rb
hamlit-2.8.1 lib/hamlit/helpers.rb
hamlit-2.8.0 lib/hamlit/helpers.rb
hamlit-2.7.5 lib/hamlit/helpers.rb
hamlit-2.7.3 lib/hamlit/helpers.rb
hamlit-2.7.2 lib/hamlit/helpers.rb
hamlit-2.7.1 lib/hamlit/helpers.rb
hamlit-2.7.0 lib/hamlit/helpers.rb
hamlit-2.6.2 lib/hamlit/helpers.rb