[pull] main from Milkdown:main#190
Merged
Merged
Conversation
* feat: per-block diff via LCS matching Replace the single-ReplaceStep diff with an LCS-based per-block matcher that recurses into container nodes (bullet_list, blockquote, table...). Unrelated edits in adjacent blocks no longer collapse into one big merged change, so the review UI can surface them as independent accept/reject units. Along the way, fix a few rendering bugs in the components package that this exposed: - hasBlockContent wrongly flagged attribute-only edits on list_item and other container open-tokens as block content, wrapping the enclosing list/blockquote in a removed-block decoration. - mergeBlockChanges expanded pure inserts/deletes sitting at a custom block boundary into the neighbouring block, double-rendering tables and requiring repeated accept clicks to clear a single change. - Inserts at the doc end anchored after the trailing empty paragraph Crepe keeps as a placeholder, pushing it out of its trailing slot and leaving an orphaned block-deletion widget on the next recompute. * refactor: address review feedback on per-block diff - Type the token encoder as TokenEncoder<string | number> to drop the `as unknown as null` casts and let the encoder methods return their actual values. - Replace the large-container fallback's self-wrapping (parent.copy of the container inside itself) with a direct ChangeSet over the container's content, translated by contentStart. Avoids the off-by-one abs translation and the structurally odd parent === node wrapper. - Coalesce with every already-emitted custom-block entry that overlaps, not just the first one, so the merged output never contains overlapping duplicate custom-block ranges. * refactor: address second round of review feedback - Clarify the computeDocDiff docstring: a range that happens to cover the full doc still uses the per-block path; only a sub-region range takes the legacy single-step fallback. - Avoid wasted signature computation for large containers. diffChildrenLcs now takes raw nodes and checks childCount against LCS_MAX_CHILDREN before building ParentPair / signatures, so the fallback path no longer walks the whole subtree to compute tokens it immediately throws away. - Rename the misleading "blockquote text edit" test to accurately reflect that it exercises nested ul/li/p recursion.
* chore: bump up pnpm/action-setup action to v6 * [autofix.ci] apply automated fixes * chore: f * [autofix.ci] apply automated fixes --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Saul-Mirone <Saul-Mirone@outlook.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )