From 23df60dba5682255ce6f60e3ee8e6901f6a70c7b Mon Sep 17 00:00:00 2001 From: Fabian Aggeler <35527968+UBaggeler@users.noreply.github.com> Date: Thu, 7 Mar 2024 19:22:02 +0100 Subject: [PATCH] fix(richtext-lexical): Link: add open-in-new-tab to html converter --- .../src/utilities/lexical/converters/link.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/plugin-form-builder/src/utilities/lexical/converters/link.ts b/packages/plugin-form-builder/src/utilities/lexical/converters/link.ts index 34d6d7a6db4..785b391f53b 100644 --- a/packages/plugin-form-builder/src/utilities/lexical/converters/link.ts +++ b/packages/plugin-form-builder/src/utilities/lexical/converters/link.ts @@ -16,6 +16,7 @@ export const LinkHTMLConverter: HTMLConverter = { }) const rel: string = node.fields.newTab ? ' rel="noopener noreferrer"' : '' + const target: string = node.fields.newTab ? ' target="_blank"' : '' let href: string = node.fields.linkType === 'custom' ? node.fields.url : node.fields.doc?.value?.id @@ -24,7 +25,7 @@ export const LinkHTMLConverter: HTMLConverter = { href = replaceDoubleCurlys(href, submissionData) } - return `${childrenText}` + return `${childrenText}` }, nodeTypes: ['link'], }