Class: ReverseAdoc::Converters::Li

Inherits:
Base
  • Object
show all
Defined in:
lib/reverse_adoc/converters/li.rb

Instance Method Summary collapse

Methods inherited from Base

#constrained?, #escape_keychars, #extract_title, #node_has_ancestor?, #textnode_before_end_with?, #treat, #treat_children, #treat_children_coradoc, #treat_coradoc, #unconstrained_after?, #unconstrained_before?

Instance Method Details

#convert(node, state = {}) ⇒ Object



10
11
12
# File 'lib/reverse_adoc/converters/li.rb', line 10

def convert(node, state = {})
  Coradoc::Generator.gen_adoc(to_coradoc(node, state))
end

#to_coradoc(node, state = {}) ⇒ Object



4
5
6
7
8
# File 'lib/reverse_adoc/converters/li.rb', line 4

def to_coradoc(node, state = {})
  id = node["id"]
  content = treat_children_coradoc(node, state)
  Coradoc::Element::ListItem.new(content, id: id)
end