We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 3211411 + d182756 commit 254c44eCopy full SHA for 254c44e
1 file changed
src/marks/Link.js
@@ -60,10 +60,15 @@ const Link = TipTapLink.extend({
60
61
renderHTML(options) {
62
const { mark } = options
63
- const url = new URL(mark.attrs.href, window.location)
64
- const href = PROTOCOLS_TO_LINK_TO.includes(url.protocol)
65
- ? domHref(mark, this.options.relativePath)
66
- : '#'
+ let href
+ try {
+ const url = new URL(mark.attrs.href, window.location)
+ href = PROTOCOLS_TO_LINK_TO.includes(url.protocol)
67
+ ? domHref(mark, this.options.relativePath)
68
+ : '#'
69
+ } catch (error) {
70
+ href = '#'
71
+ }
72
return ['a', {
73
...mark.attrs,
74
href,
0 commit comments