From 6c32a39fe807f96e23794e1d7996a6063898a081 Mon Sep 17 00:00:00 2001 From: Jason Chen Date: Sun, 16 Apr 2017 20:27:37 -0700 Subject: [PATCH] fix #1339 --- modules/keyboard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/keyboard.js b/modules/keyboard.js index 84cd836278..20cb270956 100644 --- a/modules/keyboard.js +++ b/modules/keyboard.js @@ -275,7 +275,7 @@ function handleBackspace(range, context) { if (range.index === 0 || this.quill.getLength() <= 1) return; let [line, ] = this.quill.getLine(range.index); let formats = {}; - if (context.offset === 0) { + if (context.offset === 0 && line.prev != null && line.prev.length() > 1) { let curFormats = line.formats(); let prevFormats = this.quill.getFormat(range.index-1, 1); formats = DeltaOp.attributes.diff(curFormats, prevFormats) || {};