class PseudoHiki::TableRowParser::InlineElement::TableCellNode

Attributes

cell_type[RW]
colspan[RW]
rowspan[RW]

Public Class Methods

new() click to toggle source
Calls superclass method
# File lib/pseudohiki/inlineparser.rb, line 118
def initialize
  super
  @cell_type, @rowspan, @colspan = TD, 1, 1
end

Public Instance Methods

parse_cellspan(token_str) click to toggle source
# File lib/pseudohiki/inlineparser.rb, line 130
def parse_cellspan(token_str)
  m = MODIFIED_CELL_PAT.match(token_str) and cell_modifiers = m[0]
  return token_str if cell_modifiers.empty?
  @cell_type = TH if cell_modifiers.start_with? TH_PAT
  @rowspan = cell_modifiers.count(ROW_EXPANDER) + 1
  @colspan = cell_modifiers.count(COL_EXPANDER) + 1
  m.post_match
end
parse_first_token(orig_tokens) click to toggle source
# File lib/pseudohiki/inlineparser.rb, line 139
def parse_first_token(orig_tokens)
  return orig_tokens if orig_tokens.kind_of? InlineParser::InlineNode
  orig_tokens.dup.tap {|tokens| tokens[0] = parse_cellspan(tokens[0]) }
end
push(token) click to toggle source
Calls superclass method
# File lib/pseudohiki/inlineparser.rb, line 144
def push(token)
  return super(token) unless empty?
  super(parse_first_token(token))
end