mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-28 23:59:25 +08:00
fix: fix adding mark only with insertContent(), fix #264
This commit is contained in:
parent
28d30a1034
commit
0a6312382f
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user