Sha256: a17b8a5b91080821cb7b046536c9e19c0d41998e76beadc3a4f3c9dd2f1c7a1d

Contents?: true

Size: 1.35 KB

Versions: 3

Compression:

Stored size: 1.35 KB

Contents

# frozen_string_literal: true
module Arbre
  module HTML

    AUTO_BUILD_ELEMENTS = [ :a, :abbr, :address, :area, :article, :aside, :audio, :b, :base,
                       :bdo, :blockquote, :body, :br, :button, :canvas, :caption, :cite,
                       :code, :col, :colgroup, :command, :datalist, :dd, :del, :details,
                       :dfn, :div, :dl, :dt, :em, :embed, :fieldset, :figcaption, :figure,
                       :footer, :form, :h1, :h2, :h3, :h4, :h5, :h6, :head, :header, :hgroup,
                       :hr, :html, :i, :iframe, :img, :input, :ins, :keygen, :kbd, :label,
                       :legend, :li, :link, :main, :map, :mark, :menu, :menuitem, :meta, :meter, :nav, :noscript,
                       :object, :ol, :optgroup, :option, :output, :param, :pre, :progress, :q,
                       :s, :samp, :script, :section, :select, :small, :source, :span,
                       :strong, :style, :sub, :summary, :sup, :svg, :table, :tbody, :td,
                       :textarea, :tfoot, :th, :thead, :time, :title, :tr, :track, :ul, :var, :video, :wbr ]

    HTML5_ELEMENTS = [ :p ] + AUTO_BUILD_ELEMENTS

    AUTO_BUILD_ELEMENTS.each do |name|
      class_eval <<-EOF
        class #{name.to_s.capitalize} < Tag
          builder_method :#{name}
        end
      EOF
    end

    class P < Tag
      builder_method :para
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
arbre-2.0.2 lib/arbre/html/html5_elements.rb
arbre-2.0.1 lib/arbre/html/html5_elements.rb
arbre-2.0.0 lib/arbre/html/html5_elements.rb