class Hikkoshi::Ghost::PostProcessor::TableDowngrader::Part

Attributes

text[R]

Public Class Methods

new(is_table:) click to toggle source
# File lib/hikkoshi/ghost/post_processor/table_downgrader.rb, line 38
def initialize(is_table:)
  @text = ""
  @is_table = is_table
end

Public Instance Methods

<<(text) click to toggle source
# File lib/hikkoshi/ghost/post_processor/table_downgrader.rb, line 47
def <<(text)
  @text << text
end
convert_table(text) click to toggle source
# File lib/hikkoshi/ghost/post_processor/table_downgrader.rb, line 60
def convert_table(text)
  CONVERTER.render(text)
end
converted_text() click to toggle source
# File lib/hikkoshi/ghost/post_processor/table_downgrader.rb, line 51
def converted_text
  if self.table?
    # TODO: make this optional
    convert_table(@text) + "\n<!--\n#{@text}\n-->\n"
  else
    @text
  end
end
table?() click to toggle source
# File lib/hikkoshi/ghost/post_processor/table_downgrader.rb, line 43
def table?
  @is_table
end