Skip to content

Commit

Permalink
'a' tags now always have explicit end tag to prevent some browsers th…
Browse files Browse the repository at this point in the history
…inking the tags are open
  • Loading branch information
weavejester committed Jul 18, 2009
1 parent 5e1a96f commit 086b486
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/compojure/html/gen.clj
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@
(declare html)

(defvar- container-tags
#{:body :b :dd :div :dl :dt :em :fieldset :form :h1 :h2 :h3 :h4 :h5 :h6 :head
:html :i :label :li :ol :pre :script :span :strong :style :textarea :ul}
#{:a :b :body :dd :div :dl :dt :em :fieldset :form :h1 :h2 :h3 :h4 :h5 :h6
:head :html :i :label :li :ol :pre :script :span :strong :style :textarea
:ul}
"A list of tags that need an explicit ending tag when rendered.")

(defn explicit-ending-tag?
Expand Down
3 changes: 3 additions & 0 deletions test/compojure/html/gen.clj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
(is (= (html [:h1]) "<h1></h1>"))
(is (= (html [:script]) "<script></script>")))

(deftest empty-links-tag
(is (= (html [:a]) "<a></a>")))

(deftest tags-can-be-strs
(is (= (html ["div"] "<div></div>"))))

Expand Down

0 comments on commit 086b486

Please sign in to comment.