Skip to content

Derive semantic Markdown changes - #9047

Open
hweihwang wants to merge 1 commit into
mainfrom
review/structured-markdown-comparison-model
Open

Derive semantic Markdown changes#9047
hweihwang wants to merge 1 commit into
mainfrom
review/structured-markdown-comparison-model

Conversation

@hweihwang

@hweihwang hweihwang commented Aug 14, 2026

Copy link
Copy Markdown

Part 1 of the version-comparison work for nextcloud/collectives#599: the semantic model that turns two Markdown revisions into a typed list of changes.

  • Two documents in, typed changes out, built on ProseMirror ChangeSet
  • Changes classified as text, formatting, attribute, structure or unknown, with conservative move detection
  • An explicit complexity limit: you get a bounded result, never a silent partial list

First of six. Followed by #9048, #9049 and #9050 in this repo, then nextcloud/collectives#2699 and #2700.

Full story, screenshots and the test matrix live in the #599 implementation update: nextcloud/collectives#599 (comment)

@benjaminfrueh

Copy link
Copy Markdown
Contributor

@hweihwang Tested: 3-column table (headers A/B/C, data x/x/x), delete column C. Header change is reported correctly as C, but the data row shows column A as changed instead of column C. I think it could be because all three "x" cells are identical.

Assisted-by: OpenAI Codex:gpt-5.6-sol
Signed-off-by: Hoang Pham <hoangmaths96@gmail.com>
@hweihwang
hweihwang force-pushed the review/structured-markdown-comparison-model branch from 802f3e4 to c599581 Compare September 1, 2026 21:09
@hweihwang
hweihwang marked this pull request as ready for review September 1, 2026 21:24
@hweihwang

Copy link
Copy Markdown
Author

Thanks for the concrete reproduction. This is exactly the case T01 now pins.

At the commit you reviewed, the three identical body cells (x/x/x) gave the column alignment no evidence to tell which column was deleted, so the body rows could be attributed to the wrong column even though the header resolved correctly.

The fix landed as regression test T01 (attributes the duplicate-body column deletion) at the current tip: deleting column C from a 3-column header with two x/x/x body rows must emit a single table-column delete whose descriptors point at column C for the header and both data rows.

Reproduced against the current tip (c599581): one table-column delete, descriptors at before paths [0,0,2], [0,1,2], [0,2,2]. Header and both rows agree on column C. T01/T02 also cover insertion and first/middle/last variants.

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.

2 participants