remove firstChild from parseFromString
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,4 @@
|
|||||||
|
.history
|
||||||
.DS_Store
|
.DS_Store
|
||||||
node_modules
|
node_modules
|
||||||
dist/
|
dist/
|
||||||
|
|||||||
20570
package-lock.json
generated
Normal file
20570
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -274,7 +274,7 @@ export default class Editor extends Emitter {
|
|||||||
if (typeof content === 'string') {
|
if (typeof content === 'string') {
|
||||||
const htmlString = `<div>${content}</div>`;
|
const htmlString = `<div>${content}</div>`;
|
||||||
const parser = new window.DOMParser;
|
const parser = new window.DOMParser;
|
||||||
const element = parser.parseFromString(htmlString, "text/html").body.firstChild;
|
const element = parser.parseFromString(htmlString, "text/html").body;
|
||||||
return DOMParser.fromSchema(this.schema).parse(element, parseOptions)
|
return DOMParser.fromSchema(this.schema).parse(element, parseOptions)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user