mustache 2.1.3 → 2.1.4
raw patch · 4 files changed
+13/−2 lines, 4 files
Files
- CHANGELOG.md +4/−0
- mustache.cabal +2/−2
- src/Text/Mustache/Render.hs +1/−0
- test/unit/Spec.hs +6/−0
CHANGELOG.md view
@@ -1,5 +1,9 @@ # Mustache library changelog +## v2.1.4++- Treat Null as falsy in sections+ ## v2.1.3 - Added excaping for the apostrophe "'" as per xml spec, courtesy to @tfausak
mustache.cabal view
@@ -1,5 +1,5 @@ name: mustache-version: 2.1.3+version: 2.1.4 synopsis: A mustache template parser library. description: Allows parsing and rendering template files with mustache markup. See the@@ -33,7 +33,7 @@ type: git branch: master location: git://github.com/JustusAdam/mustache.git- tag: v2.1.3+ tag: v2.1.4
src/Text/Mustache/Render.hs view
@@ -150,6 +150,7 @@ in mapM_ (substitute' newContext) secSTree Just (Bool False) -> return ()+ Just Null -> return () Just (Lambda l) -> mapM_ (substitute' context) (l context secSTree) Just focus' -> let
test/unit/Spec.hs view
@@ -173,6 +173,12 @@ (object ["section" ~> False]) `shouldBe` "" + it "does not substitute a section when the key is present (and null)" $+ substitute+ (toTemplate [Section (NamedData ["section"]) [TextBlock "t"]])+ (object ["section" ~> Null])+ `shouldBe` ""+ it "does not substitute a section when the key is present (and empty list)" $ substitute (toTemplate [Section (NamedData ["section"]) [TextBlock "t"]])