我正在尝试使用一些在线工具将HTML
代码块转换为jade,但似乎没有一个对我有用,现在让我告诉我在这里做错了,因为我是新手,因此使用这些工具。< / p>
HTML代码 -
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js sidebar-large lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js sidebar-large lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js sidebar-large lt-ie9"> <![endif]-->
<!--[if gt IE 8]> <html class="no-js sidebar-large"> <![endif]-->
退回的玉码 -
doctype html
html.no-js.sidebar-large
// <![endif]
由于我的html文件太大,我正在按块转换此块,因此在使用时超出了单词/字符限制。
使用的工具 -
答案 0 :(得分:0)
除非您为他们提供带有正确开头和结尾标记的干净标记,否则这些工具不会给您合适的结果。
在我上面提到的示例中,它不起作用,因为我在<html>
之后没有包含<!DOCTYPE html>
。
所以正确的代码是 -
<!DOCTYPE html>
<html>
<!--[if lt IE 7]> <html class="no-js sidebar-large lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js sidebar-large lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js sidebar-large lt-ie9"> <![endif]-->
<!--[if gt IE 8]> <html class="no-js sidebar-large"> <![endif]-->
JADE 结果 -
!!! 5
html
//if lt IE 7
//if IE 7
//if IE 8
//if gt IE 8