mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-27 14:59:27 +08:00
fix(link): Do not convert link href
to number or boolean (#5391)
This commit is contained in:
parent
84febb29c7
commit
08b4319215
5
.changeset/link-href-parsing-fix.md
Normal file
5
.changeset/link-href-parsing-fix.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"@tiptap/extension-link": fix
|
||||
---
|
||||
|
||||
Fixes a bug where link `href` was converted to number or boolean during HTML parsing, leading to a crash in rendering.
|
@ -164,6 +164,9 @@ export const Link = Mark.create<LinkOptions>({
|
||||
return {
|
||||
href: {
|
||||
default: null,
|
||||
parseHTML(element) {
|
||||
return element.getAttribute('href')
|
||||
},
|
||||
},
|
||||
target: {
|
||||
default: this.options.HTMLAttributes.target,
|
||||
@ -187,7 +190,7 @@ export const Link = Mark.create<LinkOptions>({
|
||||
if (!href || !isAllowedUri(href)) {
|
||||
return false
|
||||
}
|
||||
return { href }
|
||||
return null
|
||||
},
|
||||
}]
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user