fix: fix adding mark only with insertContent(), fix #264

This commit is contained in:
Philipp Kühn 2021-04-12 12:39:36 +02:00
parent 28d30a1034
commit 0a6312382f

View File

@ -1,7 +1,3 @@
export default function elementFromString(value: string): HTMLElement {
const htmlString = `<div>${value}</div>`
const parser = new window.DOMParser()
const element = parser.parseFromString(htmlString, 'text/html').body
return element
return new window.DOMParser().parseFromString(value, 'text/html').body
}