Sha256: dc87a6ae0a2c571b4ba5ac6abecd8192b2ff0eb798c0568667cc6bbdd736e9bc

Contents?: true

Size: 658 Bytes

Versions: 47

Compression:

Stored size: 658 Bytes

Contents

# frozen_string_literal: true
module Haml
  class HTML < Temple::HTML::Fast
    DEPRECATED_FORMATS = %i[html4 html5].freeze

    def initialize(opts = {})
      if DEPRECATED_FORMATS.include?(opts[:format])
        opts = opts.dup
        opts[:format] = :html
      end
      super(opts)
    end

    # This dispatcher supports Haml's "revealed" conditional comment.
    def on_html_condcomment(condition, content, revealed = false)
      on_html_comment [:multi,
                       [:static, "[#{condition}]>#{'<!-->' if revealed}"],
                       content,
                       [:static, "#{'<!--' if revealed}<![endif]"]]
    end
  end
end

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
haml-6.3.0 lib/haml/html.rb
haml-6.2.5 lib/haml/html.rb
haml-6.2.4 lib/haml/html.rb
haml-6.2.3 lib/haml/html.rb
haml-6.2.2 lib/haml/html.rb
haml-6.2.1 lib/haml/html.rb
haml-6.2.0 lib/haml/html.rb
haml-6.1.4-java lib/haml/html.rb
haml-6.1.4 lib/haml/html.rb
haml-6.1.3-java lib/haml/html.rb
haml-6.1.3 lib/haml/html.rb
haml-6.1.2-java lib/haml/html.rb
haml-6.1.2 lib/haml/html.rb
haml-6.1.1-java lib/haml/html.rb
haml-6.1.1 lib/haml/html.rb
haml-6.1.0-java lib/haml/html.rb
haml-6.1.0 lib/haml/html.rb
haml-6.0.12-java lib/haml/html.rb
haml-6.0.12 lib/haml/html.rb
haml-6.0.11-java lib/haml/html.rb