ginger 0.10.0.0 → 0.10.0.2
raw patch · 2 files changed
+17/−7 lines, 2 filesdep ~aeson
Dependency ranges changed: aeson
Files
- ginger.cabal +2/−2
- src/Text/Ginger/Parse.hs +15/−5
ginger.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: ginger-version: 0.10.0.0+version: 0.10.0.2 synopsis: An implementation of the Jinja2 template language in Haskell description: Ginger is Jinja, minus the most blatant pythonisms. Wants to be feature complete, but isn't quite there yet.@@ -40,7 +40,7 @@ -- other-modules: -- other-extensions: build-depends: base >=4.8 && <5- , aeson >=1.4.2.0 && <1.5+ , aeson >=1.4.2.0 && <1.6 , aeson-pretty >=0.8.7 && <0.9 , bytestring >=0.10.8.2 && <0.11 , data-default >= 0.5
src/Text/Ginger/Parse.hs view
@@ -37,7 +37,7 @@ , runParserT , try, lookAhead , manyTill, oneOf, string, notFollowedBy, between, sepBy- , eof, spaces, anyChar, noneOf, char+ , eof, space, spaces, anyChar, noneOf, char , choice, option, optionMaybe , unexpected , digit@@ -439,15 +439,25 @@ literalStmtP :: Monad m => Parser m (Statement SourcePos) literalStmtP = do pos <- getPosition- txt <- manyTill literalCharP endOfLiteralP+ txt <- concat <$> manyTill literalCharsP endOfLiteralP case txt of [] -> unexpected "{{" _ -> return . LiteralS pos . unsafeRawHtml . Text.pack $ txt -literalCharP :: Monad m => Parser m Char-literalCharP =- literalNewlineP <|> anyChar+literalCharsP :: Monad m => Parser m [Char]+literalCharsP = do+ dlims <- psDelimiters <$> getState+ let forbiddenChars =+ nub . sort $+ " \t\r\n" +++ delimOpenInterpolation dlims +++ delimOpenComment dlims +++ delimOpenTag dlims+ (some $ noneOf forbiddenChars) <|>+ (fmap (:[]) literalNewlineP) <|>+ some space <|>+ (fmap (:[]) anyChar) literalNewlineP :: Monad m => Parser m Char literalNewlineP = do