From 79550c4817dd89fd0f9b79fee26f6b5c5d84e4b7 Mon Sep 17 00:00:00 2001 From: Peter Birrer Date: Tue, 4 Feb 2025 10:33:10 +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 d19d589383b..a6f32eea6f8 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') }} +