From 09308b729bb1a5fc4ce5bfeae31daee760cd7ce1 Mon Sep 17 00:00:00 2001 From: Neil Jenkins Date: Thu, 17 Nov 2011 18:32:11 +1100 Subject: [PATCH] Fix bug in hasFormat Must see at least one text node with format to return true. --- source/Editor.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/Editor.js b/source/Editor.js index a287923..10236a9 100644 --- a/source/Editor.js +++ b/source/Editor.js @@ -413,13 +413,15 @@ FILTER_ACCEPT : FILTER_SKIP; }, false ); + var seenNode = false; while ( node = walker.nextNode() ) { if ( !node.nearest( tag, attributes ) ) { return false; } + seenNode = true; } - return true; + return seenNode; }; var addFormat = function ( tag, attributes, range ) {