packages feed

mustache 2.1.2 → 2.1.3

raw patch · 5 files changed

+15/−6 lines, 5 files

Files

CHANGELOG.md view
@@ -1,5 +1,9 @@ # Mustache library changelog +## v2.1.3++- Added excaping for the apostrophe "'" as per xml spec, courtesy to @tfausak+ ## v2.1.2  - Fixed template cahce again, as the spec requires access to the previous cache in partials as well
README.md view
@@ -37,6 +37,10 @@  Current implementation substitutes the `TEMPLATE` once with each `DATA-FILE` +#### Example++    $ haskell-mustache my-template-file data-file-1.json data-file-2.json data-file-3.json+ ## Roadmap  - [x] String parser for mustache templates
mustache.cabal view
@@ -1,5 +1,5 @@ name:                mustache-version:             2.1.2+version:             2.1.3 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+  tag:      v2.1.3   
src/Text/Mustache/Internal.hs view
@@ -34,6 +34,7 @@ xmlEntities :: [(String, String)] xmlEntities =   [ ("quot", "\"")+  , ("#39", "'")   , ("amp" , "&")   , ("lt"  , "<")   , ("gt"  , ">")
test/unit/Spec.hs view
@@ -116,14 +116,14 @@     it "substitutes a html escaped value for a variable" $       substitute         (toTemplate [Variable escaped (NamedData ["name"])])-        (object ["name" ~> ("<tag>" :: T.Text)])-      `shouldBe` "&lt;tag&gt;"+        (object ["name" ~> ("\" ' < > &" :: T.Text)])+      `shouldBe` "&quot; &#39; &lt; &gt; &amp;"      it "substitutes raw value for an unescaped variable" $       substitute         (toTemplate [Variable unescaped (NamedData ["name"])])-        (object ["name" ~> ("<tag>" :: T.Text)])-      `shouldBe` "<tag>"+        (object ["name" ~> ("\" ' < > &" :: T.Text)])+      `shouldBe` "\" ' < > &"      it "substitutes a section when the key is present (and an empty object)" $       substitute