Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Explicit ending tags for <section>, <aside>, and others #51

Merged
merged 1 commit into from

2 participants

@kevinfahy

Added explicit end tags for aside, header, nav, article, section, footer, and hgroup.

@weavejester
Owner

Makes sense.

@weavejester weavejester merged commit fcd6668 into weavejester:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 4 deletions.
  1. +4 −3 src/hiccup/compiler.clj
  2. +2 −1  test/hiccup/test/core.clj
View
7 src/hiccup/compiler.clj
@@ -36,9 +36,10 @@
(def ^{:doc "A list of elements that need an explicit ending tag when rendered."
:private true}
container-tags
- #{"a" "b" "body" "canvas" "dd" "div" "dl" "dt" "em" "fieldset" "form" "h1" "h2" "h3"
- "h4" "h5" "h6" "head" "html" "i" "iframe" "label" "li" "ol" "option" "pre"
- "script" "span" "strong" "style" "table" "textarea" "title" "ul"})
+ #{"a" "article" "aside" "b" "body" "canvas" "dd" "div" "dl" "dt" "em" "fieldset"
+ "footer" "form" "h1" "h2" "h3" "h4" "h5" "h6" "head" "header" "hgroup" "html"
+ "i" "iframe" "label" "li" "nav" "ol" "option" "pre" "section" "script" "span"
+ "strong" "style" "table" "textarea" "title" "ul"})
(defn normalize-element
"Ensure an element vector is of the form [tag-name attrs content]."
View
3  test/hiccup/test/core.clj
@@ -25,7 +25,8 @@
(is (= (html [:text]) "<text />"))
(is (= (html [:a]) "<a></a>"))
(is (= (html [:iframe]) "<iframe></iframe>"))
- (is (= (html [:title]) "<title></title>")))
+ (is (= (html [:title]) "<title></title>"))
+ (is (= (html [:section]) "<section></section>")))
(testing "tags containing text"
(is (= (html [:text "Lorem Ipsum"]) "<text>Lorem Ipsum</text>")))
(testing "contents are concatenated"
Something went wrong with that request. Please try again.