Skip to content

Commit

Permalink
Merge pull request #51 from kevinfahy/master
Browse files Browse the repository at this point in the history
Explicit ending tags for <section>, <aside>, and others
  • Loading branch information
weavejester committed May 22, 2012
2 parents f0d5221 + c7dd5cb commit fcd6668
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/hiccup/compiler.clj
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@
(def ^{:doc "A list of elements that need an explicit ending tag when rendered." (def ^{:doc "A list of elements that need an explicit ending tag when rendered."
:private true} :private true}
container-tags container-tags
#{"a" "b" "body" "canvas" "dd" "div" "dl" "dt" "em" "fieldset" "form" "h1" "h2" "h3" #{"a" "article" "aside" "b" "body" "canvas" "dd" "div" "dl" "dt" "em" "fieldset"
"h4" "h5" "h6" "head" "html" "i" "iframe" "label" "li" "ol" "option" "pre" "footer" "form" "h1" "h2" "h3" "h4" "h5" "h6" "head" "header" "hgroup" "html"
"script" "span" "strong" "style" "table" "textarea" "title" "ul"}) "i" "iframe" "label" "li" "nav" "ol" "option" "pre" "section" "script" "span"
"strong" "style" "table" "textarea" "title" "ul"})


(defn normalize-element (defn normalize-element
"Ensure an element vector is of the form [tag-name attrs content]." "Ensure an element vector is of the form [tag-name attrs content]."
Expand Down
3 changes: 2 additions & 1 deletion test/hiccup/test/core.clj
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
(is (= (html [:text]) "<text />")) (is (= (html [:text]) "<text />"))
(is (= (html [:a]) "<a></a>")) (is (= (html [:a]) "<a></a>"))
(is (= (html [:iframe]) "<iframe></iframe>")) (is (= (html [:iframe]) "<iframe></iframe>"))
(is (= (html [:title]) "<title></title>"))) (is (= (html [:title]) "<title></title>"))
(is (= (html [:section]) "<section></section>")))
(testing "tags containing text" (testing "tags containing text"
(is (= (html [:text "Lorem Ipsum"]) "<text>Lorem Ipsum</text>"))) (is (= (html [:text "Lorem Ipsum"]) "<text>Lorem Ipsum</text>")))
(testing "contents are concatenated" (testing "contents are concatenated"
Expand Down

0 comments on commit fcd6668

Please sign in to comment.