From 0e7a10c6ad865fa9075636787b1dac09d767bf06 Mon Sep 17 00:00:00 2001 From: Jason Chen Date: Wed, 17 May 2017 23:29:56 -0700 Subject: [PATCH] fix #1427 --- core/editor.js | 4 ++++ 1 file changed, 4 insertions(+) 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);