Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
37 lines (36 sloc) 1.67 KB
(equal (xmlgen-extract-plist '(h1 :class "big" "A Title"))
'((h1 "A Title") (:class "big")))
(equal (xmlgen-extract-plist '(hello :big "world"))
'((hello) (:big "world")))
(equal (xmlgen-extract-plist '(big :one 1 :two 2 :three 3))
'((big) (:one 1 :two 2 :three 3))
"Slightly bigger plist")
(error (xmlgen-extract-plist '(hello "world" :how))
"Error thrown when plist is wrong size"))
(equal (xmlgen-attr-to-string '(:one "1" :two "2")) " one=\"1\" two=\"2\""))
(equal "This & this" (xmlgen-string-escape "This & this"))
(equal "This &lt;&amp;&gt; this" (xmlgen-string-escape "This <&> this")))
(equal (xmlgen '(p "this & this")) "<p>this &amp; this</p>")
(equal (xmlgen '(p :class "big")) "<p class=\"big\"/>")
(equal (xmlgen '(p :class "big" "hi")) "<p class=\"big\">hi</p>")
(equal (xmlgen '(h1)) "<h1/>")
(equal (xmlgen '(h1 "Title")) "<h1>Title</h1>")
(equal (xmlgen '(h1 :class "something" "hi"))
"<h1 class=\"something\">hi</h1>")
(equal (xmlgen '(div (p "Escaped: &") (!unescape (p "Unescaped: &") (!escape
(p "& escaped")))))
"<div><p>Escaped: &amp;</p><p>Unescaped: &</p><p>&amp; escaped</p></div>")
(equal (xmlgen '(p "hello" "again")) "<p>helloagain</p>")
("more complex"
(equal (xmlgen
(title "hello")
(meta :something "hi"))))
(concat "<html><head><title>hello</title><meta something=\"hi\"/></head></html>"))))))
Something went wrong with that request. Please try again.