Class: HtmlToProsemirror::Nodes::ListItem
- Defined in:
- lib/html_to_prosemirror/nodes/list_item.rb
Instance Attribute Summary
Attributes inherited from Node
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(dom_node) ⇒ ListItem
constructor
A new instance of ListItem.
- #matching ⇒ Object
Constructor Details
#initialize(dom_node) ⇒ ListItem
Returns a new instance of ListItem.
4 5 6 7 |
# File 'lib/html_to_prosemirror/nodes/list_item.rb', line 4 def initialize(dom_node) super(dom_node) @wrapper = { type: 'paragraph' } end |
Instance Method Details
#data ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/html_to_prosemirror/nodes/list_item.rb', line 13 def data if(@node.children.length === 1 && @node.children[0].name === 'p') @wrapper = nil end { type: "list_item" } end |
#matching ⇒ Object
9 10 11 |
# File 'lib/html_to_prosemirror/nodes/list_item.rb', line 9 def matching @node.name === 'li' end |