[WIKI-569] regression: parser kit extensions mismatch#7885
Conversation
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughReplaced StarterKit.configure(...) with CustomStarterKitExtension({ enableHistory: true }) in CoreEditorExtensionsWithoutProps, updating the starter-kit initialization and enabling history. Imports adjusted accordingly; other listed extensions remain unchanged. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Editor
participant CoreExtensions as CoreEditorExtensionsWithoutProps
participant CustomStarterKit as CustomStarterKitExtension
participant OtherExt as Other Extensions
participant History
Editor->>CoreExtensions: Request extension list
Note over CoreExtensions: Initialization path updated
CoreExtensions->>CustomStarterKit: Instantiate { enableHistory: true }
CustomStarterKit-->>History: Initialize history support
CoreExtensions-->>OtherExt: Include Emoji/Link/Image/Quote/HR/etc.
CoreExtensions-->>Editor: Return composed extensions
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests
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 |
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug where multiple link extensions were being registered via the parser kit by replacing the direct TipTap StarterKit usage with a custom starter kit extension.
- Removes direct StarterKit import and configuration
- Introduces CustomStarterKitExtension with streamlined configuration
- Simplifies extension configurations by removing inline options
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| import { ImageExtensionConfig } from "./image"; | ||
| import { CustomMentionExtensionConfig } from "./mentions/extension-config"; | ||
| import { CustomQuoteExtension } from "./quote"; | ||
| import { CustomStarterKitExtension } from "./starter-kit"; |
There was a problem hiding this comment.
The CustomStarterKitExtension import is added but the corresponding file './starter-kit' may not exist or may not export this function. This could cause a runtime error if the module is not properly implemented.
| CustomHorizontalRule, | ||
| CustomLinkExtension, |
There was a problem hiding this comment.
CustomHorizontalRule and CustomLinkExtension are now used without their previous configurations. This removes important styling (CSS classes) and functionality (link validation, protocols). The removed configurations should be preserved either in the CustomStarterKitExtension or applied here to maintain the same behavior.
| CustomHorizontalRule, | |
| CustomLinkExtension, | |
| CustomHorizontalRule.configure({ | |
| HTMLAttributes: { | |
| class: "my-4 border-t border-gray-300", // Example, replace with your actual class | |
| }, | |
| }), | |
| CustomLinkExtension.configure({ | |
| HTMLAttributes: { | |
| class: "text-blue-600 underline", // Example, replace with your actual class | |
| }, | |
| validate: href => { | |
| // Example validation: allow only http, https, mailto, and tel | |
| return /^(https?:\/\/|mailto:|tel:)/.test(href); | |
| }, | |
| protocols: ['http', 'https', 'mailto', 'tel'], | |
| }), |
|
Linked to Plane Work Item(s) This comment was auto-generated by Plane |
Description
This PR fixes the bug where multiple link extensions were being registered via the parser kit.
Type of Change
Summary by CodeRabbit