Class: Escapement::Element::Paragraph
- Inherits:
-
Base
- Object
- Base
- Escapement::Element::Paragraph
show all
- Defined in:
- lib/escapement/elements/paragraph.rb
Instance Attribute Summary
Attributes inherited from Base
#node, #result
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#initialize
#node_to_type
Methods included from Traversal
#process_children
Class Method Details
.should_handle?(node) ⇒ Boolean
4
5
6
|
# File 'lib/escapement/elements/paragraph.rb', line 4
def self.should_handle?(node)
['p', 'li'].include? node.name
end
|
Instance Method Details
#process! ⇒ Object
8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/escapement/elements/paragraph.rb', line 8
def process!
return if node_is_blank?
process_children
@result = {
type: node_to_type,
html_tag: node.name,
text: node.text,
entities: @entities
}
end
|