mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-01 03:27:52 +00:00
fix: Appending markdown as HTML into editor (#2720)
This commit is contained in:
committed by
GitHub
parent
8f30abb98b
commit
672e5874fb
@@ -139,8 +139,17 @@ export default {
|
|||||||
value(newValue = '') {
|
value(newValue = '') {
|
||||||
if (newValue !== this.lastValue) {
|
if (newValue !== this.lastValue) {
|
||||||
const { tr } = this.state;
|
const { tr } = this.state;
|
||||||
|
if (this.isFormatMode) {
|
||||||
|
this.state = createState(
|
||||||
|
newValue,
|
||||||
|
this.placeholder,
|
||||||
|
this.plugins,
|
||||||
|
this.isFormatMode
|
||||||
|
);
|
||||||
|
} else {
|
||||||
tr.insertText(newValue, 0, tr.doc.content.size);
|
tr.insertText(newValue, 0, tr.doc.content.size);
|
||||||
this.state = this.view.state.apply(tr);
|
this.state = this.view.state.apply(tr);
|
||||||
|
}
|
||||||
this.view.updateState(this.state);
|
this.view.updateState(this.state);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user