From 8cf5cf90366a4f5f8e0efaf3bb39c0c4f8f512e0 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 4 May 2013 11:02:56 +0100 Subject: Fix list index 0 matching any paragraph --- lib/document-matchers.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/document-matchers.js b/lib/document-matchers.js index 58b3204..e681349 100644 --- a/lib/document-matchers.js +++ b/lib/document-matchers.js @@ -17,8 +17,8 @@ function Matcher(elementType, styleName) { Matcher.prototype.matches = function(element) { return element.type === this._elementType && - (!this._styleName || element.styleName === this._styleName) && - (!this._listIndex || isList(element, this._listIndex, this._listIsOrdered)); + (this._styleName === undefined || element.styleName === this._styleName) && + (this._listIndex === undefined || isList(element, this._listIndex, this._listIsOrdered)); } Matcher.prototype.orderedList = function(levelIndex) { -- cgit v1.2.3