2016-06-12 63 views
0

我有這兩個HTML片段,我想知道生產它們所需要的玉:如何repruduce IE玉模板破解

<body> 
    <!--[if (gte mso 9)|(IE)]> 
    <table width="540" align="center" cellpadding="0" cellspacing="0" border="0"> 
    <tr> 
    <td> 
    <![endif]--> 

    <table class="content" align="center" cellpadding="0" cellspacing="0" border="0" style="font-family: sans-serif; width: 100%; max-width: 540px; background: #ffffff;"> 
    <tr> 
    <td> 

而且

<!--[if (gte mso 9)|(IE)]> 
    </td> 
    </tr> 
    </table> 
    <![endif]--> 

似乎無法轉換或預測或使用:足夠好的逐字逐句。有任何想法嗎?

+0

真的沒有必要檢查大於IE9的版本,因爲IE10不再支持條件註釋 – slebetman

回答

1

轉換器可以幫助你。

html2jade.org是您的特定問題的資源。

這是你的代碼的輸出:

html 
    body 
    //if (gte mso 9)|(IE) 
     table(width='540', align='center', cellpadding='0', cellspacing='0', border='0') 
     tr 
      td 
    table.content(align='center', cellpadding='0', cellspacing='0', border='0', style='font-family: sans-serif; width: 100%; max-width: 540px; background: #ffffff;') 
     tr 
     td 

  //if (gte mso 9)|(IE) 
+0

我使用了該網站。問題是,如果你嘗試轉換回來,你會得到不同於原始的html。 – Costa

0

該解決方案:!= "<!--[if IE]><script src=\"//html5shiv.googlecode.com/svn/trunk/html5.js\"></script><![endif]-->"

編譯到:<!--[if IE]><script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->

!= "<!--[if IE]>" 
your code here 
!= "\n" 
!= "<![endif]-->"