Repository navigation
fix(core): render previews from the newer source in diffs and suggestions - #3157
Merged
nperez0111 merged 2 commits intoOct 6, 2026
Merged
Conversation
…ions
Plain content (math, diagrams, custom source blocks) read its text with
deleted text merged in, so a preview rendered neither version ("xy^23").
Plain content now leaves out text marked as deleted.
Hovering such a preview names the change "Changed", since the preview
can't show what was inserted or deleted. The preview path is scoped to
nodes that declare meta.hasPreview or don't display their content, so a
checklist checkbox no longer shows its label's change.
Adds a Mermaid diagram scenario to the suggestion gallery.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
@blocknote/ariakit
@blocknote/code-block
@blocknote/core
@blocknote/diagram-block
@blocknote/mantine
@blocknote/math-block
@blocknote/react
@blocknote/server-util
@blocknote/shadcn
@blocknote/xl-ai
@blocknote/xl-docx-exporter
@blocknote/xl-email-exporter
@blocknote/xl-multi-column
@blocknote/xl-odt-exporter
@blocknote/xl-pdf-exporter
@blocknote/xl-typst-exporter
commit: |
|
This branch was successfully deployed
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Stacked on #3090.
Problem
In a version diff or suggestion, editing the source of a math, diagram or other preview block rendered both versions merged together:
x^2→y^3previewed asxy^23, and a Mermaid node renamed Review → Publish rendered as "RevPubliewsh". Plain content was read withnode.textContent, which includes text marked as deleted.Hovering such a preview also named an arbitrary change ("Deleted by: A"), and hovering a checklist checkbox showed the tooltip of its label's text change.
Changes
y-attributed-delete(plainContentTextinnodeToBlock.ts). The source editor still shows the struck-through and inserted text.AttributionChangegets a"change"kind for hovers through a preview. Newchanged/changed_bystrings in all locales.meta.hasPreviewor don't display their content, so other controls (checkbox, toggle button) no longer pick up a text change.Styled content is unchanged:
editor.documentstill includes deleted text for paragraphs etc. A note incontentNodeToInlineContentcovers the trade-offs of filtering it too.Release notes
modificationType: "change".editor.document,onChangeand exports read plain blocks (code, math, diagrams) as the newer text.Tests
xy^23).x+zy).