如何将<!-[if lt IE 9]>标记嵌入Blaze.Html5生成的HTML中?

尼克·布克

我正在尝试使用该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此处的文档未提供任何线索。

阿列克谢·库林(Alexey Kurin)

您可以使用preEscapedTextfrom 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] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章