fix: inline code clears comments (BLO-1207) (BLO-1363) - #2832
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe code mark now uses a shared helper to exclude formatting marks while allowing non-formatting marks, including comments. Unit and end-to-end tests cover exclusion behavior and applying inline code to commented text. ChangesCode and Comment Mark Overlap
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to Inline code can coexist with comment annotations while formatting-mark exclusions remain intact. No actionable merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Linked Issues checkExplanation Issue Full details: Out of Scope Changes checkExplanation The changes in
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. A rabbit marks a word in code, 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: |
|
5023d0e to
41938f6
Compare
nperez0111
left a comment
There was a problem hiding this comment.
This looks good now, I couldn't find a simpler solution than to flatten the extensions straight from the options like you did
| strike: createStyleSpecFromTipTapMark(Strike, "boolean"), | ||
| code: createStyleSpecFromTipTapMark( | ||
| Code.extend({ | ||
| excludes() { |
There was a problem hiding this comment.
I think we have NON_FORMATTING_MARK_GROUP for this right? cc @nperez0111 ?
There was a problem hiding this comment.
Ah yea, true. we would need a function similar to nonFormattingMarks which sort of does the same thing based on group membership
Summary
This PR fixes an issues where comments cannot overlap inline code. This is because the inline code mark has
exclude: "_"in its spec, meaning no other marks can overlap it. This makes sense for things like colors and bold/italic/etc, but not comments. Therefore, an exception has been added.Closes #2803 #3084
Rationale
This is a bug.
Changes
Codemark withonBeforeCreateto remove the comment mark from theexcludearray.Impact
N/A
Testing
Added e2e test.
Screenshots/Video
N/A
Checklist
Additional Notes
N/A
Summary by CodeRabbit
Summary by CodeRabbit