Skip to content

Preserve untouched tables and add aligned source formatting - #78

Closed
BinaryOutlook wants to merge 3 commits into
mainfrom
feat/table-markdown-style
Closed

BinaryOutlook wants to merge 3 commits into
mainfrom
feat/table-markdown-style

Conversation

@BinaryOutlook

Copy link
Copy Markdown
Owner

A small visual edit currently reconstructs every table in the document, creating formatting-only diffs even when those tables were untouched. Preserve each recognized table's source unless its cells, structure, or column alignment change. Editing a paragraph now leaves all table source intact; editing table A formats A while retaining table B verbatim.

Add binary-markdown.tableSourceFormat with Aligned as the default and Compact (Legacy) as the compatibility option in VS Code and desktop Preferences. The preference applies to new or modified tables. Live setting changes preserve the document, selection, and undo history. Localize the setting in all seven supported languages and document the behavior.

The source is retained on each table node and compared with its current serialized cell data. Source-mode edits, undo/redo, and external formatting-only updates refresh that baseline. Export preparation excludes the retained-source metadata. Empty-cell placeholders are distinguished from authored line breaks, and header-only alignment is retained.

Validation on Node 24.21.0:

  • 128 focused browser tests passed, including exact-source preservation, neighboring tables, undo/redo, Source mode, external updates, table operations, equations, and export preparation.
  • 278 unit tests passed. The initial unit run skipped 18 opt-in real-converter tests and the package gate; the package gate subsequently passed against the freshly built VSIX.
  • Installed VSIX checks passed in an isolated VS Code 1.138.0 profile on macOS ARM64: 12 scenario receipts plus frozen-input verification, covering real saves/reopening, both formats, settings precedence, retained selection/undo, and untouched neighboring tables.
  • Root compilation, Electron TypeScript compilation, and packaging passed. Lint reported 0 errors and 11 existing warnings.
  • Documentation/link checks and whitespace checks passed. Affected Markdown was reviewed in source and rendered previews.

Scope: preservation applies to tables supported by the existing parser. Other Markdown normalization remains unchanged, and widening a column can still reformat the edited table. Reduced diff noise does not establish a measured Git-storage reduction. Native Electron and cross-platform installed-extension validation are not claimed by the local checks.

Based on refreshed main at 41ea238a99aea72b197fa33dc1001bd9ef09a0e5; implementation and testing used a dedicated worktree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant