fix: Appending markdown as HTML into editor (#2720)
This commit is contained in:
parent
8f30abb98b
commit
672e5874fb
1 changed files with 11 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue