简体   繁体   English

Outlook 条件 html 格式(如果是 mso)

[英]Outlook conditional html formatting (if mso)

It isn't clear to me if code such as the following is unique to Outlook only:我不清楚以下代码是否仅适用于 Outlook:

<p><!--[if mso]><br><![endif]--></p>

Looking up info re "mso" I find that it means "MS Office", however all the examples on the web refer to Outlook being the target for this conditional html code.查找有关“mso”的信息,我发现它的意思是“MS Office”,但是网络上的所有示例都将 Outlook 作为此条件 html 代码的目标。

Q : Does MS Word or OneNote also generate conditional html as above? Q : MS Word 或 OneNote 是否也生成如上的条件 html? Or is it unique to MS Outlook?或者它是 MS Outlook 独有的吗?

Update (again) : I tried copying from MS Word and Outlook programs and it does make use of the conditional formatting, however it looks different to the conditional formatting I gave earlier.更新(再次) :我尝试从 MS Word 和 Outlook 程序复制,它确实使用了条件格式,但是它看起来与我之前给出的条件格式不同。 We are trying to figure out what actually generated the above example which was submitted by a student and it looks like they copied from MS Word or an email.我们试图弄清楚是什么实际生成了上述由学生提交的示例,看起来他们是从 MS Word 或电子邮件复制的。

By copying text into Drupal I've found both MS Word and Outlook programs produce this code:通过将文本复制到 Drupal,我发现 MS Word 和 Outlook 程序都会生成以下代码:

<p class="MsoNormal">1<br> 2</p>
<p>&nbsp;</p>
<p class="MsoNormal">3</p>
<p>&nbsp;</p>
<p><!-- [if gte mso 9]><xml>
 <o:OfficeDocumentSettings>
  <o:AllowPNG />
 </o:OfficeDocumentSettings>
</xml><![endif]--><!-- [if gte mso 9]><xml>
 <w:WordDocument>
  <w:View>Normal</w:View>
  <w:Zoom>0</w:Zoom>
  <w:TrackMoves />
  <w:TrackFormatting />
  <w:PunctuationKerning />
... and it just keeps going with 600+ lines of Word generated code..

Meanwhile Outlook Webmail (outlook.office365.com) generated html like this:同时 Outlook Webmail (outlook.office365.com) 生成 html 如下:

<div style="font-family: Arial, Helvetica, sans-serif; font-size: 12pt; color: #000000;">1</div>
<div style="font-family: Arial, Helvetica, sans-serif; font-size: 12pt; color: #000000;">&nbsp;</div>
<div style="font-family: Arial, Helvetica, sans-serif; font-size: 12pt; color: #000000;">2</div>
<div style="font-family: Arial, Helvetica, sans-serif; font-size: 12pt; color: #000000;">&nbsp;</div>
<div style="font-family: Arial, Helvetica, sans-serif; font-size: 12pt; color: #000000;">3<br><br>4</div>
<div style="font-family: Arial, Helvetica, sans-serif; font-size: 12pt; color: #000000;">&nbsp;</div>
<div style="font-family: Arial, Helvetica, sans-serif; font-size: 12pt; color: #000000;"><br>

Source Found: We eventually found the source of the code - Matlab Online. Source Found:我们最终找到了代码的来源——Matlab Online。 Strange for a non MS product to produce the "mso" tags, but it clearly does when using Firefox and Chrome browsers (but not in Safari).非 MS 产品产生“mso”标签很奇怪,但在使用 Firefox 和 Chrome 浏览器(但不是在 Safari 中)时显然可以。

Outlook 中的 HTML 由 Word 呈现和编辑(Outlook 使用了一个 Word-light dll),所以是的,Outlook 和 Word 都使用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM