1:- module(html_comments, [ if_ie//2, html_comment//1 ]).

Tools for html comments

Various tools for html comments

Part of Weblog Licensed under the LGPL

*/

   11:-use_module(library(http/html_write)).   12:-html_meta if_ie(+,html,?,?).
 if_ie(+Cond, +HTML)// is det
Conditionally include HTML, using the Internet Explorer conditional comments mechanism http://www.quirksmode.org/css/condcom.html

For example

== \if('lte IE 8', link([ rel(stylesheet), href('http://cdn.bigco.com/stylesheet.for.ie.css') ]))

produces

<!--[if lte IE 8]> <link rel="stylesheet" href="http://cdn.bigco.com/stylesheet.for.ie.css"> <![endif]-->

==

*/

   41if_ie(Cond, HTML) -->
   42    html(\['<!--[if ', Cond, ']>' ]),
   43    html(HTML),
   44    html(\['<![endif]-->' ]).
   45
   46:- html_meta html_comment(+, ?, ?).
 html_comment(+Text)// is det
Insert an html comment */
   52html_comment(Text)-->
   53	html(\['<!-- ']),
   54	html_quoted(Text),
   55	html(\[' -->'])