revert changes to setContent
This commit is contained in:
@@ -374,10 +374,6 @@ export default class Editor extends Emitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setContent(content = {}, emitUpdate = false, parseOptions) {
|
setContent(content = {}, emitUpdate = false, parseOptions) {
|
||||||
if (!this.view.editable) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const newState = EditorState.create({
|
const newState = EditorState.create({
|
||||||
schema: this.state.schema,
|
schema: this.state.schema,
|
||||||
doc: this.createDocument(content, parseOptions),
|
doc: this.createDocument(content, parseOptions),
|
||||||
|
|||||||
@@ -240,17 +240,6 @@ test('clear content', () => {
|
|||||||
expect(editor.getHTML()).toEqual('<p></p>')
|
expect(editor.getHTML()).toEqual('<p></p>')
|
||||||
})
|
})
|
||||||
|
|
||||||
test('clear content', () => {
|
|
||||||
const editor = new Editor({
|
|
||||||
editable: false,
|
|
||||||
content: '<p>Foo</p>',
|
|
||||||
})
|
|
||||||
|
|
||||||
editor.clearContent()
|
|
||||||
|
|
||||||
expect(editor.getHTML()).toEqual('<p>Foo</p>')
|
|
||||||
})
|
|
||||||
|
|
||||||
test('init callback', done => {
|
test('init callback', done => {
|
||||||
const editor = new Editor({
|
const editor = new Editor({
|
||||||
content: '<p>Foo</p>',
|
content: '<p>Foo</p>',
|
||||||
|
|||||||
Reference in New Issue
Block a user