Skip to content

Commit

Permalink
Trailing semicolons when embedding mixins #194
Browse files Browse the repository at this point in the history
  • Loading branch information
snoyberg committed Sep 1, 2016
1 parent e79c4a0 commit 7e3bbf7
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 2.0.11.1

* Handle parsing of trailing semicolon after mixins [#194](https://github.com/yesodweb/shakespeare/issues/194)

### 2.0.11

* Export hamletFromString [#191](https://github.com/yesodweb/shakespeare/pull/191)
Expand Down
2 changes: 2 additions & 0 deletions Text/Lucius.hs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ parsePairsBlocks front = (char '}' >> return (front [])) <|> (do
whiteSpace
Right x <- parseCaret
whiteSpace
(char ';' >> return ()) <|> return ()
whiteSpace
return $ PBMixin x
checkIfBlock = do
skipMany $ noneOf "#@{};"
Expand Down
2 changes: 1 addition & 1 deletion shakespeare.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: shakespeare
version: 2.0.11
version: 2.0.11.1
license: MIT
license-file: LICENSE
author: Michael Snoyman <michael@snoyman.com>
Expand Down
15 changes: 15 additions & 0 deletions test/Text/CssSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,21 @@ foo { foo:X#{bar}Y; }
src: url(sansation_light.woff)
|]

describe "trailing semicolon in mixin" $ do
let someMixin = [luciusMixin|foo:bar|]
it "direct in lucius" $
celper "baz{foo:bar}" [lucius|
baz {
^{someMixin};
}
|]

it "implicit in cassius #194" $
celper "baz{foo:bar}" [cassius|
baz
^{someMixin}
|]

data Url = Home | Sub SubUrl
data SubUrl = SubUrl
render :: Url -> [(Text, Text)] -> Text
Expand Down

0 comments on commit 7e3bbf7

Please sign in to comment.