hsx-jmacro 6.0.0 → 6.0.1
raw patch · 2 files changed
+10/−3 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- HSX/JMacro.hs +9/−2
- hsx-jmacro.cabal +1/−1
HSX/JMacro.hs view
@@ -51,8 +51,15 @@ do i <- lift nextInteger asChild $ genElement (Nothing, "script") [asAttr ("type" := "text/javascript")]- [asChild (render $ jsToDoc $ jsSaturate (Just ('i' : show i)) jstat)]-+ [asChild (escapeForHtml $ render $ jsToDoc $ jsSaturate (Just ('i' : show i)) jstat)]+ where+ escapeForHtml :: String -> String+ escapeForHtml [] = []+ escapeForHtml [c] = [c]+ escapeForHtml (b:c:cs)+ | b == '<' && c == '/' + = b : '\\' : c : (escapeForHtml cs)+ | otherwise = b : escapeForHtml (c : cs) instance (IntegerSupply m, IsName n, EmbedAsAttr m (Attr Name String)) => EmbedAsAttr m (Attr n JStat) where asAttr (n := jstat) =
hsx-jmacro.cabal view
@@ -1,5 +1,5 @@ Name: hsx-jmacro-Version: 6.0.0+Version: 6.0.1 Synopsis: hsx+jmacro support Description: HSX allows for the use of literal XML in Haskell program text. JMacro allows for the use of javascript-syntax for generating javascript in Haskell. This library makes it easy to embed JMacro generated javascript in HSX templates. Homepage: http://www.happstack.com/