Class: HTML::BlockOrInlineTag
- Defined in:
- lib/html/tags.rb
Overview
This represents an HTML element that can be regarded as either a block or an inline element..
Instance Method Summary collapse
-
#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.
- #is_block_element ⇒ Object
Methods inherited from InlineTag
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.
77 78 79 80 81 |
# File 'lib/html/tags.rb', line 77 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_element ⇒ Object
73 |
# File 'lib/html/tags.rb', line 73 def is_block_element; true; end |