如何在 Compojure/Hiccup 中输出 HTML 注释?
我希望我的程序输出以下 HTML:
<!--[if lt IE 8]><link rel="stylesheet" href="../blueprint/ie.css" type="text/css" media="screen, projection"><![endif]-->
Is there a way tooutput html comment Lites with 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只需插入它们即可。也许这有点作弊,但它确实有效......
Just insert them. Maybe this is a little bit cheating, but it works...
你让我很好奇,所以我重新阅读了代码:没有明确的注释函数 - 你必须将其作为字符串文字传递。但是您可以这样做:
如果您确实需要该功能(尽管这非常简单)。您始终可以添加 IE if 语句作为可选参数。
You got me curious, so I re-read the code: there's no explicit comment function - you would have to pass that as a string literal. But you could do something like:
if you really needed the function (although that's pretty simplistic). You could always add the IE if statement as an optional parameter.