Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Do not unintended remove or modify link titles, fixes #2699
Signed-off-by: Ferdinand Thiessen <[email protected]>
  • Loading branch information
susnux authored and backportbot-nextcloud[bot] committed Jul 10, 2022
commit e808c66800b16944e3841406a6abee9ba2a776f8
5 changes: 4 additions & 1 deletion src/marks/Link.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ const Link = TipTapLink.extend({
href: {
default: null,
},
title: {
default: null,
},
}
},

Expand All @@ -48,14 +51,14 @@ const Link = TipTapLink.extend({
tag: 'a[href]',
getAttrs: dom => ({
href: parseHref(dom),
title: dom.getAttribute('title'),
}),
},
],

renderHTML: ({ mark, HTMLAttributes }) => ['a', {
...mark.attrs,
href: domHref(mark),
title: mark.attrs.href,
rel: 'noopener noreferrer nofollow',
}, 0],

Expand Down
1 change: 1 addition & 0 deletions src/tests/markdown.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ describe('Markdown though editor', () => {
})
test('links', () => {
expect(markdownThroughEditor('[test](foo)')).toBe('[test](foo)')
expect(markdownThroughEditor('[test](foo "bar")')).toBe('[test](foo "bar")')
})
test('images', () => {
expect(markdownThroughEditor('![test](foo)')).toBe('![test](foo)')
Expand Down