lib/asciidoctor/table.rb in asciidoctor-0.0.9 vs lib/asciidoctor/table.rb in asciidoctor-0.1.0

- old
+ new

@@ -17,10 +17,11 @@ } # Public: A Hash mapping styles abbreviations to styles that can be applied # to a table column or cell TEXT_STYLES = { + 'd' => :none, 's' => :strong, 'e' => :emphasis, 'm' => :monospaced, 'h' => :header, 'l' => :literal, @@ -405,11 +406,17 @@ def close_cell(eol = false) cell_text = @buffer.strip @buffer = '' if format == 'psv' cell_spec = take_cell_spec - repeat = cell_spec.fetch('repeatcol', 1) - cell_spec.delete('repeatcol') + if cell_spec.nil? + puts 'asciidoctor: ERROR: table missing leading separator, recovering automatically' + cell_spec = {} + repeat = 1 + else + repeat = cell_spec.fetch('repeatcol', 1) + cell_spec.delete('repeatcol') + end else cell_spec = nil repeat = 1 if format == 'csv' if !cell_text.empty? && cell_text.include?('"')