module Ronn::Utils
Constants
- HTML
-
All
HTML4 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
Source
# File lib/ronn/utils.rb, line 31 def block_element?(name) HTML_BLOCK.include?(name) end
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
Source
# File lib/ronn/utils.rb, line 39 def empty_element?(name) HTML_EMPTY.include?(name) end
Source
# File lib/ronn/utils.rb, line 43 def html_element?(name) HTML.include?(name) end
Source
# File lib/ronn/utils.rb, line 35 def inline_element?(name) HTML_INLINE.include?(name) end