From 59ee821ceccbbebc0751fa9ae2891db897eaaca7 Mon Sep 17 00:00:00 2001 From: Dan Ribbens Date: Fri, 6 Dec 2024 15:58:35 -0500 Subject: [PATCH] Revert "fix(plugin-form-builder): use escapeHTML on submission data in serializeLexical" (#9805) Reverts payloadcms/payload#8110 --- .../src/utilities/lexical/converters/link.ts | 4 +--- .../src/utilities/lexical/converters/text.ts | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) 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 7a0c4fbfe78..785b391f53b 100644 --- a/packages/plugin-form-builder/src/utilities/lexical/converters/link.ts +++ b/packages/plugin-form-builder/src/utilities/lexical/converters/link.ts @@ -1,5 +1,3 @@ -import escapeHTML from 'escape-html' - import type { HTMLConverter } from '../types' import { replaceDoubleCurlys } from '../../replaceDoubleCurlys' @@ -24,7 +22,7 @@ export const LinkHTMLConverter: HTMLConverter = { node.fields.linkType === 'custom' ? node.fields.url : node.fields.doc?.value?.id if (submissionData) { - href = escapeHTML(replaceDoubleCurlys(href, submissionData)) + href = replaceDoubleCurlys(href, submissionData) } return `${childrenText}` diff --git a/packages/plugin-form-builder/src/utilities/lexical/converters/text.ts b/packages/plugin-form-builder/src/utilities/lexical/converters/text.ts index cb0b031ec8e..0ef060c0b8d 100644 --- a/packages/plugin-form-builder/src/utilities/lexical/converters/text.ts +++ b/packages/plugin-form-builder/src/utilities/lexical/converters/text.ts @@ -1,5 +1,3 @@ -import escapeHTML from 'escape-html' - import type { HTMLConverter } from '../types' import { replaceDoubleCurlys } from '../../replaceDoubleCurlys' @@ -10,7 +8,7 @@ export const TextHTMLConverter: HTMLConverter = { let text = node.text if (submissionData) { - text = escapeHTML(replaceDoubleCurlys(text, submissionData)) + text = replaceDoubleCurlys(text, submissionData) } if (node.format & NodeFormat.IS_BOLD) {