You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix Markdown table core round-trip defects and release 0.2.0 (#23)
Five reproducible defects were found by property and fuzz testing of the
public facade and are fixed with regression coverage:
- findTableRanges could return overlapping ranges when a table was followed
by a line that was itself a valid separator, so whole-document reformatting
rewrote one row twice and corrupted the document.
- The formatter emitted tables it could not parse back: without outer pipes,
an empty edge cell produced a row ending (or starting) with a pipe that
re-parsing consumed as an outer pipe, dropping a column.
- Deleting down to one column in a table without outer pipes left rows with
no pipe at all, turning the table into plain text.
- A header made only of dashes was mistaken for the separator row, so every
edit on such a table was rejected.
- EditResult.changed was hardcoded to true instead of reporting whether the
result differs from the input.
Readability work keeps behaviour unchanged: the duplicated preamble of apply
and applyWrappedToWidth moved into resolveTable, the action switch moved into
applyAction, the two nearly identical wrap routines merged, the three column
width helpers share one accumulator, dead code is gone, and the public Javadoc
now documents the result coordinate system and the non-overlap guarantee.
Testing: new MarkdownTableCoreContractTest adds 105 cases covering alignment,
structural edits, sorting, navigation, wrapping, conversion, Unicode widths,
argument handling, immutability, and a randomised invariant sweep; four golden
fixtures pin the fixed behaviours. Core line coverage is 94%. corePerformance
gains p95 reporting and an end-to-end scenario, and passed three isolated runs.
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
0 commit comments