diff --git a/src/services/editor/cledit/cleditCore.js b/src/services/editor/cledit/cleditCore.js index 2f738b52..79ca06ab 100644 --- a/src/services/editor/cledit/cleditCore.js +++ b/src/services/editor/cledit/cleditCore.js @@ -286,6 +286,7 @@ function cledit(contentElt, scrollEltOpt, isMarkdown = false) { editor.setContent(newContent, false, min); contentChanging = true; skipSaveSelection = true; + highlighter.cancelComposition = true; } min = state.before.length; max = min + state.selection.length; diff --git a/src/services/editor/cledit/cleditHighlighter.js b/src/services/editor/cledit/cleditHighlighter.js index 3d8bb199..2b688f85 100644 --- a/src/services/editor/cledit/cleditHighlighter.js +++ b/src/services/editor/cledit/cleditHighlighter.js @@ -62,10 +62,11 @@ function Highlighter(editor) { } this.parseSections = (content, isInit) => { - if (this.isComposing) { + if (this.isComposing && !this.cancelComposition) { return sectionList; } + this.cancelComposition = false; const newSectionList = (editor.options.sectionParser ? editor.options.sectionParser(content) : [content])