Class: Coradoc::Input::HTML::Converters::Sup

Inherits:
Base
  • Object
show all
Defined in:
lib/coradoc/input/html/converters/sup.rb

Instance Method Summary collapse

Methods inherited from Base

#convert, #extract_leading_trailing_whitespace, #extract_title, #node_has_ancestor?, #textnode_after_start_with?, #textnode_before_end_with?, #treat, #treat_children, #treat_children_coradoc, #treat_coradoc, #unconstrained_after?, #unconstrained_before?

Instance Method Details

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



4
5
6
7
8
9
10
11
12
13
# File 'lib/coradoc/input/html/converters/sup.rb', line 4

def to_coradoc(node, state = {})
  leading_whitespace, trailing_whitespace = extract_leading_trailing_whitespace(node)

  content = treat_children_coradoc(node, state)

  return content if Coradoc::Generator.gen_adoc(content).strip.empty?

  e = Coradoc::Element::Inline::Superscript.new(content)
  [leading_whitespace, e, trailing_whitespace]
end