Search code examples
clojurecompojurehiccup

How Can I Output an HTML Comment in Compojure/Hiccup?


I'd like my program to output the following HTML:

<!--[if lt IE 8]><link rel="stylesheet" href="../blueprint/ie.css" type="text/css" media="screen, projection"><![endif]-->

Is there a way to output html comment literals with Hiccup?


Solution

  • Just insert them. Maybe this is a little bit cheating, but it works...

    user=> (html
             [:html
              [:head
               "<!--[if lt IE 8]>"
               [:link {:rel  "stylesheet"
                       :href "../blueprint/ie.css"
                       :type "text/css"
                       :media "screen,projection"}]
               "<![endif]-->"]])
    <html><head><!--[if lt IE 8]><link href=\"../blueprint/ie.css\" media=\"screen,projection\" rel=\"stylesheet\" type=\"text/css\" /><![endif]--></head></html>