From 2c673b6b7bb6e1ad7b76686c6dc39fcd094aa13e Mon Sep 17 00:00:00 2001 From: Peter Birrer Date: Wed, 18 Dec 2024 11:18:12 +0100 Subject: [PATCH] feat(editor): add "Open in new tab" option for link previews - Enhanced `PreviewOptions.vue` to include a new "Open in new tab" button for link previews. - Introduced the `openLink` method to open the link in a new browser tab. - Added `OpenIcon` for the button to improve UI consistency. - New `href` prop added to handle link URLs dynamically. - Updated `extractLinkParagraphs.js` to extract `href` attributes from nodes. - Ensures link previews include the necessary `href` for the "Open in new tab" action. These changes improve the user experience by allowing quick access to link previews in the editor, streamlining navigation workflows. Signed-off-by: Peter Birrer Signed-off-by: Max --- src/components/Editor/PreviewOptions.vue | 19 ++++++++++++++++++ src/plugins/extractLinkParagraphs.js | 3 ++- .../plugins/extractLinkParagraphs.spec.js | 20 ++++++++++--------- 3 files changed, 32 insertions(+), 10 deletions(-) diff --git a/src/components/Editor/PreviewOptions.vue b/src/components/Editor/PreviewOptions.vue index 33bc96dbf87..a0636d38f8f 100644 --- a/src/components/Editor/PreviewOptions.vue +++ b/src/components/Editor/PreviewOptions.vue @@ -27,6 +27,14 @@ {{ t('text', 'Show link preview') }} + + + {{ t('text','Open in new tab') }} +