fix: Link HTML attributes (BLO-915)#2687
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (2)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughRefactors link attribute handling in the Link extension to use configurable Changes
Sequence Diagram(s)(Skipped — conditions for diagrams not met.) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/core/src/extensions/tiptap-extensions/Link/link.ts (1)
119-137:⚠️ Potential issue | 🟠 MajorPreserve
noopener noreferrerwhen callers overriderel.The new shallow merge lets a custom
relreplace the default safety tokens entirely. Withtarget="_blank"still emitted, a consumer settingrel: "external"will drop opener protection and reintroduce reverse-tabnabbing risk.Suggested fix
- return [ - "a", - mergeAttributes(HTMLAttributes, this.options.HTMLAttributes), - 0, - ]; + const mergedRel = [ + HTMLAttributes.rel, + this.options.HTMLAttributes.rel, + ] + .filter(Boolean) + .join(" "); + + return [ + "a", + mergeAttributes(HTMLAttributes, { + ...this.options.HTMLAttributes, + rel: mergedRel, + }), + 0, + ];🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/core/src/extensions/tiptap-extensions/Link/link.ts` around lines 119 - 137, In renderHTML (the method using this.options.isValidLink, mergeAttributes and this.options.HTMLAttributes) the shallow merge lets a caller-supplied rel replace the default "noopener noreferrer" and thus loses opener protection when target="_blank"; after merging attributes (both in the invalid-link branch and the valid branch) ensure that if the final attributes include target === "_blank" then the rel value is normalized to include "noopener" and "noreferrer" (merge any existing tokens from the caller, avoid duplicates, e.g. split on whitespace into a Set and join back) so callers can augment rel without removing the required safety tokens.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@packages/core/src/extensions/tiptap-extensions/Link/link.ts`:
- Around line 119-137: In renderHTML (the method using this.options.isValidLink,
mergeAttributes and this.options.HTMLAttributes) the shallow merge lets a
caller-supplied rel replace the default "noopener noreferrer" and thus loses
opener protection when target="_blank"; after merging attributes (both in the
invalid-link branch and the valid branch) ensure that if the final attributes
include target === "_blank" then the rel value is normalized to include
"noopener" and "noreferrer" (merge any existing tokens from the caller, avoid
duplicates, e.g. split on whitespace into a Set and join back) so callers can
augment rel without removing the required safety tokens.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 90794851-2f1e-480c-ace5-4e03791ef8f4
⛔ Files ignored due to path filters (5)
tests/src/unit/core/formatConversion/export/__snapshots__/blocknoteHTML/hardbreak/between-links.htmlis excluded by!**/__snapshots__/**tests/src/unit/core/formatConversion/export/__snapshots__/blocknoteHTML/hardbreak/link.htmlis excluded by!**/__snapshots__/**tests/src/unit/core/formatConversion/export/__snapshots__/blocknoteHTML/link/adjacent.htmlis excluded by!**/__snapshots__/**tests/src/unit/core/formatConversion/export/__snapshots__/blocknoteHTML/link/basic.htmlis excluded by!**/__snapshots__/**tests/src/unit/core/formatConversion/export/__snapshots__/blocknoteHTML/link/styled.htmlis excluded by!**/__snapshots__/**
📒 Files selected for processing (3)
packages/core/src/extensions/tiptap-extensions/Link/link.tstests/nextjs-test-app/package.jsontests/src/unit/core/createTestEditor.ts
…me script The link extension cleanup changed the request body sent to LLMs, breaking the md5-based filenames msw-snapshot uses to look up cached responses. Migrated 56 affected snapshots to their new hashes by transplanting the recorded 200 responses into the matching new-hash files, and added `pnpm rename-msw-snapshots` so the same migration can be run again the next time the request shape changes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/xl-ai/scripts/rename-msw-snapshots.mjs`:
- Around line 75-109: The script currently replaces the 200 response from
good[0] into target without ensuring they are the same request; compute a stable
request identity (e.g. serialize request method+url+headers+body or hash
request.body + request.url) from each entry (entries[].data.request) and verify
that good[0] and target share the same identity before transplanting; if the
identities differ, increment skipped and push a skip note (similar to existing
logic) and continue, otherwise perform the response copy and deletes as before
(use symbols: groups, entries, good, bad, target, skipped, skipNotes).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 06059e7f-3873-4a90-8b8d-45023fccdeef
⛔ Files ignored due to path filters (67)
packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add and update paragraph_1_0acceced44cd885ee4439d4ef8639ba2.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/add paragraph and update selection_1_9f552939a63a167da4dd5b1abffbfc43.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add and update paragraph_1_f5ce14780d38e0a320dc0246f9fa3fa7.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/add paragraph and update selection_1_8157654938ade250b36e1dde3bf0a5c2.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add and update paragraph_1_eb11dd6643fc4f655a9d55dbd71b19b9.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Combined/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/add paragraph and update selection_1_bcb205a92155b4f033637eb9f5fb2d3b.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/delete first block_1_de1c4968c1329dacd5d81bcd2b3ed8d1.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/delete first block_1_df7ac05af05cf3c79699aabb8ea42853.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Delete/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/delete first block_1_2c1689a55eb91228110b68a63451fd1a.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link and change text within mark_1_7269bbc0b34bc5775aa44079fb454ffb.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/drop mark and link_1_e3dcd01b4daf96d961ea02871bebdc41.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/plain source block, add mention_1_697fa8208493812d2a1e80e1aaf9c5de.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/standard update_1_1aee87323867b909b4239664f8b71087.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mark_1_7e627acd5601089ce51f17d48a125d26.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, remove mention_1_191aa134e34de44ad154b02c452f2a13.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, replace content_1_f1ad8291536f56abe5780af9c67a719e.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update mention prop_1_09e4b9d91e0003a97447e19e13c71fae.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in source block, update text_1_135a07dea96ec03fd66a4f9d14bffaab.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (paragraph)_1_057de0a27c49b9bc6acd8203ecddd838.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/styles + ic in target block, add mark (word)_1_cea1695dae5f5462ee9ab5a7400fee2f.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/translate selection_1_2164172c277a84ca943d79ae55a7c655.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block prop and content_1_e89f2ff97bb5e14d9f8e7c4bbb03af6f.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block prop_1_fabe61c81d039e0c80c38121db6daef1.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type and content_1_92d996135152e832c6db18b41f6b6912.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/anthropic.messages/claude-3-7-sonnet-latest (streaming)/update block type_1_be165931651bf1c2e817e30b34cacddd.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link and change text within mark_1_02b8585f48a09784036175bf14c592cd.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/drop mark and link_1_5153f11ec2928539607eae3fc9554a2e.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/plain source block, add mention_1_f33053e9ce75e3382e59f65f47268a07.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/standard update_1_3701c48442d9b752a7ea313e3255163c.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mark_1_dd318513d3f70effe9df402a04ebe20e.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, remove mention_1_df29b6d9520b0719a02ff9f241d8fd12.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, replace content_1_353407caea15e5886ca416c18085f09c.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update mention prop_1_545d20572920e7098f9e71846d69942e.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in source block, update text_1_f94a68a64c18b7537380682b3e0fa902.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (paragraph)_1_b625ba3069c0ee0677dbab599b173252.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/styles + ic in target block, add mark (word)_1_f9207412b6a2032fd012f61be3d16b7b.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/translate selection_1_1d088b7563942b1405ced6473b89b3ea.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop and content_1_7aec058255eb34b8dd1fcc434173ed62.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block prop_1_f4d4d0847f49e3177b2090d2dfcdf4a8.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type and content_1_bb2150f4fbbd0d60e298c14879b5d98c.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/groq.chat/llama-3.3-70b-versatile (streaming)/update block type_1_0cc06aead6a8738ef5ae9397d449a4bb.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link and change text within mark_1_3b2d04fb8cc28b3327eac7fbb649212c.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/drop mark and link_1_7376633d53b21fc3dbe3c1f051cd2940.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/plain source block, add mention_1_f44ed609f9d070a9db6e3357eb3b4b12.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/standard update_1_f38c18ce0c3c0d617287e458c9a79fc6.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mark_1_58230e87771d121dabc82e08fdabeec9.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, remove mention_1_501a15f4ae0e22db498c2a018f67c304.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, replace content_1_3a53469420cab77a1672183bf403d5f1.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update mention prop_1_d2d711f753398974c968fc07f4ded143.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in source block, update text_1_42c93de53980c01c69a514f6eea5f7c7.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (paragraph)_1_c899778ecf731961e7554d0dd99c1048.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/styles + ic in target block, add mark (word)_1_6de7b8e48053b34c8c48307442ebdaf9.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/translate selection_1_2be264b1a0ad629a6626df5dc6dc95ff.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block prop and content_1_cc8d5c88299059d82196af81416f61e4.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block prop_1_c3507737f635c70e33af6d9967568ce6.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type and content_1_0e4e3658327ed05d3accbdb2649b4409.jsonis excluded by!**/__snapshots__/**packages/xl-ai/src/api/formats/html-blocks/__snapshots__/htmlBlocks.test.ts/Update/__msw_snapshots__/openai.responses/gpt-4o-2024-08-06 (streaming)/update block type_1_14269fdf643fd47ec85aa390368ef71a.jsonis excluded by!**/__snapshots__/**tests/src/unit/core/formatConversion/export/__snapshots__/html/hardbreak/between-links.htmlis excluded by!**/__snapshots__/**tests/src/unit/core/formatConversion/export/__snapshots__/html/hardbreak/link.htmlis excluded by!**/__snapshots__/**tests/src/unit/core/formatConversion/export/__snapshots__/html/link/adjacent.htmlis excluded by!**/__snapshots__/**tests/src/unit/core/formatConversion/export/__snapshots__/html/link/basic.htmlis excluded by!**/__snapshots__/**tests/src/unit/core/formatConversion/export/__snapshots__/html/link/styled.htmlis excluded by!**/__snapshots__/**tests/src/unit/core/formatConversion/export/__snapshots__/nodes/hardbreak/between-links.jsonis excluded by!**/__snapshots__/**tests/src/unit/core/formatConversion/export/__snapshots__/nodes/hardbreak/link.jsonis excluded by!**/__snapshots__/**tests/src/unit/core/formatConversion/export/__snapshots__/nodes/link/adjacent.jsonis excluded by!**/__snapshots__/**tests/src/unit/core/formatConversion/export/__snapshots__/nodes/link/basic.jsonis excluded by!**/__snapshots__/**tests/src/unit/core/formatConversion/export/__snapshots__/nodes/link/styled.jsonis excluded by!**/__snapshots__/**
📒 Files selected for processing (6)
packages/xl-ai/package.jsonpackages/xl-ai/scripts/rename-msw-snapshots.mjspackages/xl-ai/src/api/formats/html-blocks/htmlBlocks.test.tspackages/xl-ai/src/api/formats/json/json.test.tspackages/xl-ai/src/api/formats/markdown-blocks/markdownBlocks.test.tspackages/xl-ai/src/api/formats/tests/snapshotPath.ts
✅ Files skipped from review due to trivial changes (1)
- packages/xl-ai/package.json
The link mark no longer stores target/rel as schema attrs; they're applied during HTML rendering via HTMLAttributes options. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@blocknote/ariakit
@blocknote/code-block
@blocknote/core
@blocknote/mantine
@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
commit: |
Summary
PR #2666 added an option to add/edit the HTML attributes set on links, but this was not working correctly. This PR fixes that and cleans up some redundant code in the link extension.
Closes #1549
Rationale
See above.
Changes
this.options.HTMLAttributesto rendered link HTML.HTML_Attributesobject.Impact
N/A
Testing
Updated unit tests to include custom HTML link attributes in the editor setup, so regressions are caught in export tests.
Screenshots/Video
N/A
Checklist
Additional Notes
Summary by CodeRabbit
New Features
Tests
Chores