packages feed

mustache 2.4.1 → 2.4.2

raw patch · 4 files changed

+12/−2 lines, 4 files

Files

CHANGELOG.md view
@@ -1,7 +1,10 @@ # Mustache library changelog -## v2.4.1+## v2.4.2 +- Also treat Null as falsey in inverted sections++## v2.4.1 - Compatibility with `containers >= 0.2.17`  ## v2.4.0
mustache.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack  name:           mustache-version:        2.4.1+version:        2.4.2 synopsis:       A mustache template parser library. description:    Allows parsing and rendering template files with mustache markup. See the                 mustache <http://mustache.github.io/mustache.5.html language reference>.
src/Text/Mustache/Render.hs view
@@ -154,6 +154,7 @@   search secName >>= \case     Just (Bool False) -> contents     Just (Array a)    | V.null a -> contents+    Just Null         -> contents     Nothing           -> contents     _                 -> return ()   where
test/unit/Spec.hs view
@@ -161,6 +161,12 @@           ])       `shouldBe` "var1var2" +    it "substitutes an inverse section when the key is present (and null)" $+      substitute+        (toTemplate [InvertedSection (NamedData ["section"]) [TextBlock "t"]])+        (object ["section" ~> Null])+      `shouldBe` "t"+     it "does not substitute a section when the key is not present" $       substitute         (toTemplate [Section (NamedData ["section"]) [TextBlock "t"]])