diff options
Diffstat (limited to 'app/assets/javascripts/content_editor/components/toolbar_link_button.vue')
-rw-r--r-- | app/assets/javascripts/content_editor/components/toolbar_link_button.vue | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/app/assets/javascripts/content_editor/components/toolbar_link_button.vue b/app/assets/javascripts/content_editor/components/toolbar_link_button.vue index f706080eaa1..8f57959a73f 100644 --- a/app/assets/javascripts/content_editor/components/toolbar_link_button.vue +++ b/app/assets/javascripts/content_editor/components/toolbar_link_button.vue @@ -43,14 +43,22 @@ export default { }, mounted() { this.tiptapEditor.on('selectionUpdate', ({ editor }) => { - const { href } = editor.getAttributes(linkContentType); + const { canonicalSrc, href } = editor.getAttributes(linkContentType); - this.linkHref = href; + this.linkHref = canonicalSrc || href; }); }, methods: { updateLink() { - this.tiptapEditor.chain().focus().unsetLink().setLink({ href: this.linkHref }).run(); + this.tiptapEditor + .chain() + .focus() + .unsetLink() + .setLink({ + href: this.linkHref, + canonicalSrc: this.linkHref, + }) + .run(); this.$emit('execute', { contentType: linkContentType }); }, |