-
Notifications
You must be signed in to change notification settings - Fork 16
fix(markdown/text-editor): properly handle internal vs external link targets #3563
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(markdown/text-editor): properly handle internal vs external link targets #3563
Conversation
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 You can disable this status message by setting the 📝 WalkthroughWalkthroughThe changes introduce a custom link attribute handling system, replacing the external Changes
Sequence Diagram(s)sequenceDiagram
participant MarkdownParser
participant createLinksPlugin
participant getLinkAttributes
MarkdownParser->>createLinksPlugin: Process Markdown AST
createLinksPlugin->>getLinkAttributes: For each <a href="...">
getLinkAttributes-->>createLinksPlugin: Return attributes (target, rel, referrerpolicy, etc.)
createLinksPlugin-->>MarkdownParser: Return transformed AST with enhanced links
sequenceDiagram
participant ProseMirrorEditor
participant getLinkAttributes
participant linkMarkSpec
ProseMirrorEditor->>getLinkAttributes: On link insertion (with URL)
getLinkAttributes-->>ProseMirrorEditor: Return link attributes
ProseMirrorEditor->>linkMarkSpec: Create link mark with attributes
linkMarkSpec-->>ProseMirrorEditor: Link mark with correct security attributes
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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
Documentation and Community
|
Documentation has been published to https://lundalogik.github.io/lime-elements/versions/PR-3563/ |
@coderabbitai review |
✅ Actions performedReview triggered.
|
src/components/text-editor/prosemirror-adapter/plugins/link/utils.ts
Outdated
Show resolved
Hide resolved
src/components/text-editor/prosemirror-adapter/plugins/link/utils.ts
Outdated
Show resolved
Hide resolved
56d76d2
to
a56a90f
Compare
Fixes https://github.com/Lundalogik/crm-feature/issues/4397
@coderabbitai summary
How to Test
Open the Rich Text Editor
Check Markdown Component
Expected Results
Review:
Browsers tested:
(Check any that applies, it's ok to leave boxes unchecked if testing something didn't seem relevant.)
Windows:
Linux:
macOS:
Mobile: