class Hikkoshi::Ghost::PostProcessor::TableDowngrader
Constants
- CONVERTER
Public Class Methods
new(content)
click to toggle source
# File lib/hikkoshi/ghost/post_processor/table_downgrader.rb, line 7 def initialize(content) @lines = content.lines end
Public Instance Methods
downgrade()
click to toggle source
# File lib/hikkoshi/ghost/post_processor/table_downgrader.rb, line 11 def downgrade flag_of_table = Array.new(@lines.size) parts = [] current_part = Part.new(is_table: false) @lines.each_with_index do |line, i| current_line_is_table = line.start_with? "|" if current_line_is_table != current_part.table? # change to new part parts << current_part current_part = Part.new(is_table: current_line_is_table) end current_part << line end # last part parts << current_part parts.map(&:converted_text).join end