hamlet 0.5.0.1 → 0.5.0.2
raw patch · 3 files changed
+27/−3 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Text/Hamlet/Parse.hs +6/−2
- hamlet.cabal +1/−1
- runtests.hs +20/−0
Text/Hamlet/Parse.hs view
@@ -75,9 +75,9 @@ backslash <|> try controlIf <|> try controlElseIf <|>- try (string "$else" >> eol >> return LineElse) <|>+ try (string "$else" >> many (oneOf " \t") >> eol >> return LineElse) <|> try controlMaybe <|>- try (string "$nothing" >> eol >> return LineNothing) <|>+ try (string "$nothing" >> many (oneOf " \t") >> eol >> return LineNothing) <|> try controlForall <|> tag <|> (do@@ -106,12 +106,14 @@ _ <- string "$if" spaces x <- deref False+ _ <- many $ oneOf " \t" eol return $ LineIf x controlElseIf = do _ <- string "$elseif" spaces x <- deref False+ _ <- many $ oneOf " \t" eol return $ LineElseIf x controlMaybe = do@@ -120,6 +122,7 @@ x <- deref False spaces y <- ident+ _ <- many $ oneOf " \t" eol return $ LineMaybe x y controlForall = do@@ -128,6 +131,7 @@ x <- deref False spaces y <- ident+ _ <- many $ oneOf " \t" eol return $ LineForall x y tag = do
hamlet.cabal view
@@ -1,5 +1,5 @@ name: hamlet-version: 0.5.0.1+version: 0.5.0.2 license: BSD3 license-file: LICENSE author: Michael Snoyman <michael@snoyman.com>
runtests.hs view
@@ -78,6 +78,7 @@ , testCase "cassius pseudo-class" casePseudo , testCase "different binding names" caseDiffBindNames , testCase "blank line" caseBlankLine + , testCase "leading spaces" caseLeadingSpaces ] data Url = Home | Sub SubUrl @@ -709,3 +710,22 @@ bar: baz |] + +caseLeadingSpaces :: Assertion +caseLeadingSpaces = + celper "foo{bar:baz}" [$cassius| + foo + bar: baz +|] + +caseTrailingSpaces :: Assertion +caseTrailingSpaces = helper "" [$hamlet| +$if True +$elseif False +$else +$maybe Nothing x +$nothing +$forall empty x +|] + where + empty = []