[WEB-2723] fix: callout content not being saved in description html#5920
[WEB-2723] fix: callout content not being saved in description html#5920SatishGandham merged 1 commit intopreviewfrom
Conversation
WalkthroughThe changes in this pull request focus on the Changes
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
packages/editor/src/core/extensions/callout/extension-config.ts (1)
66-66: Consider adding documentation for the renderHTML implementation.The
0parameter plays a crucial role in content preservation, but its purpose isn't immediately clear. Consider adding a comment explaining that this parameter specifies the content position in Tiptap's node rendering system.Example documentation:
renderHTML({ HTMLAttributes }) { + // The third parameter (0) indicates where the node's content should be rendered + // This is crucial for proper content preservation in Tiptap's node system return ["callout-component", mergeAttributes(HTMLAttributes), 0]; },
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- packages/editor/src/core/extensions/callout/extension-config.ts (1 hunks)
🔇 Additional comments (2)
packages/editor/src/core/extensions/callout/extension-config.ts (2)
Line range hint
21-29: LGTM! Good optimization of attribute handling.The change from
maptoreduceis a good optimization as it directly accumulates attributes into an object without creating an intermediate array. However, this change appears unrelated to the core issue of callout content not being saved.
66-66: Correct fix for content preservation.Adding the content position parameter (0) is the right fix for ensuring callout content is saved. This follows Tiptap's node rendering pattern where the third parameter indicates where the content should be rendered within the node.
Let's verify this pattern is consistent with other similar components:
Fixes:
Callout content no being saved in the html format.
Summary by CodeRabbit
New Features
Bug Fixes