Method: #isHTML5Element

Defined in:
lib/cem/ccommon.rb

#isHTML5Element(element) ⇒ Object



127
128
129
130
131
132
133
134
135
# File 'lib/cem/ccommon.rb', line 127

def isHTML5Element(element)

  # https://html.spec.whatwg.org/#elements-3

  @valid_elements ||= %w(a abbr address area article aside audio b base bdi bdo blockquote body br button canvas caption cite code col colgroup data datalist dd del details dfn dialog 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 kbd label legend li link main map mark math menu meta meter nav noscript object ol optgroup option output p param picture pre progress q rp rt ruby s samp script section select slot small source span strong style sub summary sup svg table tbody td template textarea tfoot th thead time title tr track u ul var video wbr)

  return @valid_elements.include?(element.to_s.downcase)

end