Class: HTML::BlockOrInlineTag

Inherits:
InlineTag show all
Defined in:
lib/web/htmltools/tags.rb

Overview

This represents an HTML element that can be regarded as either a block or an inline element..

Instance Method Summary collapse

Methods inherited from InlineTag

#is_inline_element

Methods inherited from Tag

add_tag, #can_ignore_whitespace, #can_omit_end_tag, #initialize, #is_empty_element, #is_inline_element, #name, named

Constructor Details

This class inherits a constructor from HTML::Tag

Instance Method Details

#can_contain(tag, parent) ⇒ Object

If used as inline elements (e.g., within another inline element or a P), these elements should not contain any block-level elements.



76
77
78
79
80
# File 'lib/web/htmltools/tags.rb', line 76

def can_contain(tag, parent)
  return ((parent.downcase == 'p' \
    or Tag.named(parent).is_inline_element) \
      and ! Tag.named(tag).is_block_element)
end

#is_block_elementObject



72
# File 'lib/web/htmltools/tags.rb', line 72

def is_block_element; true; end