module Ronn::Utils
Constants
- HTML
All HTML 4 elements and some that are in common use.
- HTML_BLOCK
Block elements.
- HTML_EMPTY
Elements that don't have a closing tag.
- HTML_INLINE
Inline elements
Public Instance Methods
block_element?(name)
click to toggle source
# File lib/ronn/utils.rb, line 31 def block_element?(name) HTML_BLOCK.include?(name) end
child_of?(node, tag)
click to toggle source
# File lib/ronn/utils.rb, line 47 def child_of?(node, tag) while node return true if node.name && node.name.downcase == tag node = node.parent end false end
empty_element?(name)
click to toggle source
# File lib/ronn/utils.rb, line 39 def empty_element?(name) HTML_EMPTY.include?(name) end
html_element?(name)
click to toggle source
# File lib/ronn/utils.rb, line 43 def html_element?(name) HTML.include?(name) end
inline_element?(name)
click to toggle source
# File lib/ronn/utils.rb, line 35 def inline_element?(name) HTML_INLINE.include?(name) end