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
31 def block_element?(name)
32   HTML_BLOCK.include?(name)
33 end
child_of?(node, tag) click to toggle source
   # File lib/ronn/utils.rb
47 def child_of?(node, tag)
48   while node
49     return true if node.name && node.name.downcase == tag
50     node = node.parent
51   end
52   false
53 end
empty_element?(name) click to toggle source
   # File lib/ronn/utils.rb
39 def empty_element?(name)
40   HTML_EMPTY.include?(name)
41 end
html_element?(name) click to toggle source
   # File lib/ronn/utils.rb
43 def html_element?(name)
44   HTML.include?(name)
45 end
inline_element?(name) click to toggle source
   # File lib/ronn/utils.rb
35 def inline_element?(name)
36   HTML_INLINE.include?(name)
37 end