From 0a6312382f38af5b8fdf7f94fc4b6c1de1a15e25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Mon, 12 Apr 2021 12:39:36 +0200 Subject: [PATCH] fix: fix adding mark only with insertContent(), fix #264 --- packages/core/src/utilities/elementFromString.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/core/src/utilities/elementFromString.ts b/packages/core/src/utilities/elementFromString.ts index 6240a975527..14f711b076d 100644 --- a/packages/core/src/utilities/elementFromString.ts +++ b/packages/core/src/utilities/elementFromString.ts @@ -1,7 +1,3 @@ export default function elementFromString(value: string): HTMLElement { - const htmlString = `
${value}
` - const parser = new window.DOMParser() - const element = parser.parseFromString(htmlString, 'text/html').body - - return element + return new window.DOMParser().parseFromString(value, 'text/html').body }