packages feed

shakespeare 2.0.11.2 → 2.0.12

raw patch · 3 files changed

+16/−12 lines, 3 files

Files

ChangeLog.md view
@@ -1,3 +1,7 @@+### 2.0.12++* Parser fails without space between class and ID (Hamlet) [#197](https://github.com/yesodweb/shakespeare/issues/197)+ ### 2.0.11.2  * Support for template-haskell 2.12.0 [#196](https://github.com/yesodweb/shakespeare/pull/196)
Text/Hamlet/Parse.hs view
@@ -246,12 +246,18 @@         cc [] = []         cc (ContentRaw a:ContentRaw b:c) = cc $ ContentRaw (a ++ b) : c         cc (a:b) = a : cc b-    content' cr = contentHash <|> contentAt <|> contentCaret-                              <|> contentUnder-                              <|> contentReg' cr-    contentHash = do++    content' cr =     contentHash cr+                  <|> contentAt+                  <|> contentCaret+                  <|> contentUnder+                  <|> contentReg' cr+    contentHash cr = do         x <- parseHash         case x of+            Left "#" -> case cr of+                          InContent -> return (ContentRaw "#", False)+                          _ -> fail "Expected hash at end of line, got Id"             Left str -> return (ContentRaw str, null str)             Right deref -> return (ContentVar deref, False)     contentAt = do@@ -281,13 +287,7 @@     tagCond = do         d <- between (char ':') (char ':') parseDeref         tagClass (Just d) <|> tagAttrib (Just d)-    tagClass x = do-        clazz <- char '.' >> tagAttribValue NotInQuotes-        let hasHash (ContentRaw s) = any (== '#') s-            hasHash _ = False-        if any hasHash clazz-            then fail $ "Invalid class: " ++ show clazz ++ ". Did you want a space between a class and an ID?"-            else return (TagClass (x, clazz))+    tagClass x = char '.' >> (TagClass . ((,)x)) <$> tagAttribValue NotInQuotes     tagAttrib cond = do         s <- many1 $ noneOf " \t=\r\n><"         v <- (char '=' >> Just <$> tagAttribValue NotInQuotesAttr) <|> return Nothing
shakespeare.cabal view
@@ -1,5 +1,5 @@ name:            shakespeare-version:         2.0.11.2+version:         2.0.12 license:         MIT license-file:    LICENSE author:          Michael Snoyman <michael@snoyman.com>