< o: p > 元素到底是做什么的?

在通过 Outlook 转发电子邮件之后,我遇到了一些(标准)问题,比如微软 Office 在 html 中注入了令人讨厌的标记。

我想知道:

  • 是否有解释哪些 <o:p>元素 确实是的资源
  • 通常注入哪些其他 MSO 元素
123800 次浏览

Couldn't find any official documentation (no surprise there) but according to this interesting article, those elements are injected in order to enable Word to convert the HTML back to fully compatible Word document, with everything preserved.

The relevant paragraph:

Microsoft added the special tags to Word's HTML with an eye toward backward compatibility. Microsoft wanted you to be able to save files in HTML complete with all of the tracking, comments, formatting, and other special Word features found in traditional DOC files. If you save a file in HTML and then reload it in Word, theoretically you don't loose anything at all.

This makes lots of sense.

For your specific question.. the o in the <o:p> means "Office namespace" so anything following the o: in a tag means "I'm part of Office namespace" - in case of <o:p> it just means paragraph, the equivalent of the ordinary <p> tag.

I assume that every HTML tag has its Office "equivalent" and they have more.