stache 2.0.0 → 2.0.1
raw patch · 4 files changed
+8/−3 lines, 4 filesdep ~template-haskell
Dependency ranges changed: template-haskell
Files
- CHANGELOG.md +4/−0
- Text/Mustache/Render.hs +1/−0
- stache.cabal +1/−1
- tests/Text/Mustache/RenderSpec.hs +2/−2
CHANGELOG.md view
@@ -1,3 +1,7 @@+## Stache 2.0.1++* Now interpolation with escaping also escapes single quotes as `'`.+ ## Stache 2.0.0 * Uses Megaparsec 7. In particular, the parser now returns
Text/Mustache/Render.hs view
@@ -295,6 +295,7 @@ escapeHtml :: Text -> Text escapeHtml txt = foldr (uncurry T.replace) txt [ ("\"", """)+ , ("'", "'") , ("<", "<") , (">", ">") , ("&", "&") ]
stache.cabal view
@@ -1,5 +1,5 @@ name: stache-version: 2.0.0+version: 2.0.1 cabal-version: 1.18 tested-with: GHC==7.10.3, GHC==8.0.2, GHC==8.2.2, GHC==8.4.3 license: BSD3
tests/Text/Mustache/RenderSpec.hs view
@@ -29,8 +29,8 @@ r [TextBlock "a text block"] Null `shouldBe` "a text block" it "renders escaped variables correctly" $ r [EscapedVar (key "foo")]- (object ["foo" .= ("<html>&\"something\"</html>" :: Text)])- `shouldBe` "<html>&"something"</html>"+ (object ["foo" .= ("<html>&\"'something'\"</html>" :: Text)])+ `shouldBe` "<html>&"'something'"</html>" it "renders unescaped variables “as is”" $ r [UnescapedVar (key "foo")] (object ["foo" .= ("<html>&\"something\"</html>" :: Text)])