diff --git a/packages/core/src/utilities/elementFromString.ts b/packages/core/src/utilities/elementFromString.ts index 6240a9755..14f711b07 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 }