Unparseable input is returned unchanged

All 12 scenarios hold

Formatting must never break a build: input that cannot be parsed as a well-formed table is returned exactly as it was, whatever indent is configured. Escaped quotes are not part of the table grammar, so tables containing them are left alone. The well-formed row shows the contrast: parseable input is reformatted.

expected outcome broken scenario
ScenarioTable linesConfigured indentUnchanged?
Well-formed table
  • name|age
  • Alice|30
  • space:0
  • space:4
false
Extra column in a data row
  • name|age
  • Alice|30
  • Bob|25|London
  • space:0
  • space:4
true
Missing column in a data row
  • name|age|city
  • Alice|30
  • Bob|25|London
  • space:0
  • space:4
true
Escaped quotes in a value
  • name|message
  • test|"He said \"hello\""
  • space:0
  • space:4
true
Empty input[]
  • space:0
  • space:4
true
Whitespace-only input
  • space:0
  • space:4
true