From 208318fd35c1f3107dc189e0c17330924fd74600 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 25 Jan 2015 15:37:14 +0000 Subject: Allow HTML paths with no elements --- lib/style-reader.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/style-reader.js b/lib/style-reader.js index b76478f..ef379b6 100644 --- a/lib/style-reader.js +++ b/lib/style-reader.js @@ -19,12 +19,14 @@ function createStyleRule() { lop.rules.sequence.capture(documentMatcherRule()), lop.rules.tokenOfType("whitespace"), lop.rules.tokenOfType("arrow"), - lop.rules.tokenOfType("whitespace"), - lop.rules.sequence.capture(htmlPathRule()) + lop.rules.sequence.capture(lop.rules.optional(lop.rules.sequence( + lop.rules.tokenOfType("whitespace"), + lop.rules.sequence.capture(htmlPathRule()) + ).head())) ).map(function(documentMatcher, htmlPath) { return { from: documentMatcher, - to: htmlPath + to: htmlPath.valueOrElse(htmlPaths.empty) }; }); } -- cgit v1.2.3