Module: Herb::HTML::Util

Defined in:
lib/herb/html/util.rb,
sig/herb/html/util.rbs

Constant Summary collapse

VOID_ELEMENTS =

TODO: extract to shared utility for all languages in .yml

Returns:

  • (Array[String])
["area", "base", "br", "col", "embed", "hr", "img", "input", "link", "meta", "param", "source", "track", "wbr"].freeze

Class Method Summary collapse

Class Method Details

.void_element?(tag_name) ⇒ Boolean

: (String) -> bool

Parameters:

  • (String)

Returns:

  • (Boolean)


11
12
13
# File 'lib/herb/html/util.rb', line 11

def self.void_element?(tag_name)
  VOID_ELEMENTS.include?(tag_name.downcase)
end