Fix an issue with with parsing custom extensions

see details in #747
This commit is contained in:
Kfir Ben-Ami 2020-07-27 14:30:04 +03:00 committed by GitHub
parent 97a9154375
commit a23f3a6e6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -274,7 +274,7 @@ export default class Editor extends Emitter {
if (typeof content === 'string') {
const htmlString = `<div>${content}</div>`
const parser = new window.DOMParser()
const element = parser.parseFromString(htmlString, 'text/html').body
const element = parser.parseFromString(htmlString, 'text/html').body.firstElementChild
return DOMParser.fromSchema(this.schema).parse(element, parseOptions)
}