diff options
| author | Michael Williamson <mike@zwobble.org> | 2015-01-25 15:37:14 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2015-01-25 15:37:14 +0000 |
| commit | 208318fd35c1f3107dc189e0c17330924fd74600 (patch) | |
| tree | fed47d3f32359caec2530fb480cfd4a833fcfc01 /lib | |
| parent | b79eaad70e41ea4843beced7c5e575d105362e10 (diff) | |
Allow HTML paths with no elements
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/style-reader.js | 8 |
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) }; }); } |
