fix: Appending markdown as HTML into editor (#2720)

This commit is contained in:
Nithin David Thomas 2021-07-29 11:53:28 +05:30 committed by GitHub
parent 8f30abb98b
commit 672e5874fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -139,8 +139,17 @@ export default {
value(newValue = '') {
if (newValue !== this.lastValue) {
const { tr } = this.state;
tr.insertText(newValue, 0, tr.doc.content.size);
this.state = this.view.state.apply(tr);
if (this.isFormatMode) {
this.state = createState(
newValue,
this.placeholder,
this.plugins,
this.isFormatMode
);
} else {
tr.insertText(newValue, 0, tr.doc.content.size);
this.state = this.view.state.apply(tr);
}
this.view.updateState(this.state);
}
},