lucid 2.6.0 → 2.6.1
raw patch · 3 files changed
+15/−1 lines, 3 files
Files
- lucid.cabal +1/−1
- src/Lucid/Base.hs +10/−0
- test/Main.hs +4/−0
lucid.cabal view
@@ -1,5 +1,5 @@ name: lucid-version: 2.6.0+version: 2.6.1 synopsis: Clear to write, read and edit DSL for HTML description: Clear to write, read and edit DSL for HTML. See the 'Lucid' module for description and documentation.
src/Lucid/Base.hs view
@@ -23,6 +23,7 @@ -- * Combinators ,makeElement ,makeElementNoEnd+ ,makeXmlElementNoEnd ,makeAttribute -- * Types ,Html@@ -365,6 +366,15 @@ makeElementNoEnd name = HtmlT (return (\attr _ -> s "<" <> Blaze.fromText name <> foldlMapWithKey buildAttr attr <> s ">",+ ()))++-- | Make an XML builder for elements which have no ending tag.+makeXmlElementNoEnd :: Monad m+ => Text -- ^ Name.+ -> HtmlT m () -- ^ A parent element.+makeXmlElementNoEnd name =+ HtmlT (return (\attr _ -> s "<" <> Blaze.fromText name+ <> foldlMapWithKey buildAttr attr <> s "/>", ())) -- | Build and encode an attribute.
test/Main.hs view
@@ -7,6 +7,7 @@ module Main where import Lucid+import Lucid.Base import Lucid.Bootstrap import Example1@@ -66,6 +67,9 @@ it "no closing" (renderText (p_ (input_ [])) == "<p><input></p>")+ it "no closing"+ (renderText (makeXmlElementNoEnd "p") ==+ "<p/>") -- | Test that attribute assigning works properly. testAttributes :: Spec