Class: Coradoc::Input::HTML::Converters::Tr

Inherits:
Base
  • Object
show all
Defined in:
lib/coradoc/input/html/converters/tr.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

#table_header_row?(node) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
13
# File 'lib/coradoc/input/html/converters/tr.rb', line 10

def table_header_row?(node)
  # node.element_children.all? {|child| child.name.to_sym == :th}
  node.previous_element.nil?
end

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



4
5
6
7
8
# File 'lib/coradoc/input/html/converters/tr.rb', line 4

def to_coradoc(node, state = {})
  content = treat_children_coradoc(node, state)
  header = table_header_row?(node)
  Coradoc::Element::Table::Row.new(content, header)
end