diff --git a/core/editor.js b/core/editor.js index 0546ffe5eb..515add0f4b 100644 --- a/core/editor.js +++ b/core/editor.js @@ -9,6 +9,9 @@ import equal from 'deep-equal'; import extend from 'extend'; +const ASCII = /^[ -~]*$/; + + class Editor { constructor(scroll) { this.scroll = scroll; @@ -189,6 +192,7 @@ class Editor { let oldDelta = this.delta; if (mutations.length === 1 && mutations[0].type === 'characterData' && + mutations[0].target.data.match(ASCII) && Parchment.find(mutations[0].target)) { // Optimization for character changes let textBlot = Parchment.find(mutations[0].target);