Skip to content

Commit 1ae8de7

Browse files
committed
fix: allow using latest @tiptap/extension-link version
1 parent ca2c419 commit 1ae8de7

File tree

4 files changed

+19
-11
lines changed

4 files changed

+19
-11
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
"unrs-resolver"
3636
],
3737
"overrides": {
38-
"@tiptap/extension-link": "3.15.3",
3938
"msw": "2.11.5",
4039
"ai": "6.0.5",
4140
"@ai-sdk/anthropic": "3.0.2",

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
"@tiptap/extension-code": "^3.13.0",
9999
"@tiptap/extension-horizontal-rule": "^3.13.0",
100100
"@tiptap/extension-italic": "^3.13.0",
101-
"@tiptap/extension-link": "^3.13.0",
101+
"@tiptap/extension-link": "^3.22.1",
102102
"@tiptap/extension-paragraph": "^3.13.0",
103103
"@tiptap/extension-strike": "^3.13.0",
104104
"@tiptap/extension-text": "^3.13.0",

packages/core/src/editor/managers/ExtensionManager/extensions.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,17 @@ export function getDefaultTiptapExtensions(
8181
SuggestionModificationMark,
8282
Link.extend({
8383
inclusive: false,
84-
}).configure({
84+
})
85+
.extend({
86+
// Remove the title attribute added in newer versions of @tiptap/extension-link
87+
// to avoid unnecessary null attributes in serialized output
88+
addAttributes() {
89+
const attrs = this.parent?.() || {};
90+
delete (attrs as Record<string, unknown>).title;
91+
return attrs;
92+
},
93+
})
94+
.configure({
8595
defaultProtocol: DEFAULT_LINK_PROTOCOL,
8696
// only call this once if we have multiple editors installed. Or fix https://github.com/ueberdosis/tiptap/issues/5450
8797
protocols: LINKIFY_INITIALIZED ? [] : VALID_LINK_PROTOCOLS,

pnpm-lock.yaml

Lines changed: 7 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)