aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2015-01-25 15:37:14 +0000
committerMichael Williamson <mike@zwobble.org>2015-01-25 15:37:14 +0000
commit208318fd35c1f3107dc189e0c17330924fd74600 (patch)
treefed47d3f32359caec2530fb480cfd4a833fcfc01 /lib
parentb79eaad70e41ea4843beced7c5e575d105362e10 (diff)
Allow HTML paths with no elements
Diffstat (limited to 'lib')
-rw-r--r--lib/style-reader.js8
1 files changed, 5 insertions, 3 deletions
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)
};
});
}