fix: fix adding mark only with insertContent(), fix #264
This commit is contained in:
@@ -1,7 +1,3 @@
|
|||||||
export default function elementFromString(value: string): HTMLElement {
|
export default function elementFromString(value: string): HTMLElement {
|
||||||
const htmlString = `<div>${value}</div>`
|
return new window.DOMParser().parseFromString(value, 'text/html').body
|
||||||
const parser = new window.DOMParser()
|
|
||||||
const element = parser.parseFromString(htmlString, 'text/html').body
|
|
||||||
|
|
||||||
return element
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user