From aa8527fc2c00b5ad764ebbda9fadf0e3129d09e4 Mon Sep 17 00:00:00 2001 From: Neil Jenkins Date: Fri, 9 Dec 2011 14:27:37 +1100 Subject: [PATCH] Fix bug in removing format. --- source/Editor.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/Editor.js b/source/Editor.js index 0872ba6..834e5ae 100644 --- a/source/Editor.js +++ b/source/Editor.js @@ -529,8 +529,9 @@ // If not at least partially contained, wrap entire contents // in a clone of the tag we're removing and we're done. if ( !range.containsNode( node, true ) ) { - // Ignore bookmarks - if ( node.nodeName !== 'INPUT' ) { + // Ignore bookmarks and empty text nodes + if ( node.nodeName !== 'INPUT' && + ( !isText || node.data ) ) { toWrap.push([ exemplar, node ]); } return;