From 8ec07d0d766a6d3d9b94e07b0a0fc655c18e2b20 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Tue, 22 Apr 2014 13:48:15 +0100 Subject: Add styleName to document matcher --- lib/document-matchers.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib') diff --git a/lib/document-matchers.js b/lib/document-matchers.js index 9f138ea..5075172 100644 --- a/lib/document-matchers.js +++ b/lib/document-matchers.js @@ -16,6 +16,7 @@ function Matcher(elementType, options) { options = options || {}; this._elementType = elementType; this._styleId = options.styleId; + this._styleName = options.styleName; if (options.list) { this._listIndex = options.list.levelIndex; this._listIsOrdered = options.list.isOrdered; @@ -25,6 +26,7 @@ function Matcher(elementType, options) { Matcher.prototype.matches = function(element) { return element.type === this._elementType && (this._styleId === undefined || element.styleId === this._styleId) && + (this._styleName === undefined || element.styleName === this._styleName) && (this._listIndex === undefined || isList(element, this._listIndex, this._listIsOrdered)); }; -- cgit v1.2.3