我正在尝试使用该Text.Blaze.Html5
模块输出Twitter Bootstrap的最小模板,但是它具有类似以下的注释,我不知道如何将其包含在Blaze输出中(我无法在中看到任何“注释”函数Text.Blaze.Html5
):
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
(来自http://getbootstrap.com/getting-started/#template)
我应该如何生成这样的代码?
http://jaspervdj.be/blaze/docs/Text-Blaze-Html5.html此处的文档未提供任何线索。
您可以使用preEscapedText
from Text.Blaze.Internal
。这是一个从入门工具包改编而成的示例:
import Text.Blaze.Html5 (docTypeHtml)
import Views.Utils (pet) -- `pet` is an alias for `preEscapedText`
layout t b = docTypeHtml $ do
pet "<!--[if lt IE 7]> <html class='no-js lt-ie9 lt-ie8 lt-ie7'> <![endif]-->"
pet "<!--[if IE 7]> <html class='no-js lt-ie9 lt-ie8'/> <![endif]-->"
pet "<!--[if IE 8]> <html class='no-js lt-ie9'> <![endif]-->"
pet "<!--[if gt IE 8]><!--> <html class='no-js'> <!--<![endif]-->"
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句