Publish Helper logo

將 Microsoft Word 轉換為乾淨 HTML

Microsoft Word 產生的 HTML 是所有文書處理器中最 bloated 的之一。其貼上輸出包含 XML 命名空間、針對不同 Office 版本的條件註解和 MsoNormal 段落 class。Publish Helper 可移除所有 Word 特定的標記,交付乾淨的 HTML。

I為什麼 Microsoft Word 的 HTML 這麼亂

Word 貼上的內容包含 XML 命名空間宣告(xmlns:o、xmlns:w)、針對特定 Office 版本的條件註解、MsoNormal 和 MsoListParagraph class,以及帶有 mso- 前綴屬性的 inline styles,這些屬性沒有任何瀏覽器能理解。圖片通常以 VML 或 base64 data URI 的形式嵌入,並帶有 Word 特定的 wrapper。

II清理前後對比

Microsoft Word 輸出

<p class="MsoNormal" style="margin-bottom:0cm;line-height:normal"><b><span style="font-size:14.0pt;font-family:'Calibri',sans-serif;mso-ascii-theme-font:minor-latin">Introduction</span></b></p>
<p class="MsoNormal" style="margin-bottom:0cm;line-height:normal"><span style="font-size:11.0pt;font-family:'Calibri',sans-serif;mso-ascii-theme-font:minor-latin">This is a paragraph with </span><b><span style="font-size:11.0pt">bold text</span></b><span style="font-size:11.0pt"> and </span><i><span style="font-size:11.0pt">italic text</span></i><span style="font-size:11.0pt">.</span></p>

乾淨的 HTML

<h2>Introduction</h2>
<p>This is a paragraph with <strong>bold text</strong> and <em>italic text</em>.</p>
III如何清理 Microsoft Word 的 HTML

1.從 Microsoft Word 複製您的內容

2.貼到 Publish Helper 中並設定清理選項

3.點擊清理 HTML 並複製結果

IV常見問題

為什麼 Word 的 HTML 比 Google Docs 更糟糕?

+

Word 產生的 HTML 是為了能夠往返回 Word 而設計的,而非為網頁設計。它包含 XML 命名空間、Office 特定的 CSS 屬性(mso- 前綴)和條件註解 — 這些都不是瀏覽器能理解的。Google Docs 的 HTML 雖然多餘,但至少使用標準的 CSS 屬性。

Publish Helper 能處理 Word 的項目符號列表嗎?

+

可以。Word 經常將項目符號列表轉換為帶有 MsoListParagraph class 和手動縮排的段落。Publish Helper 的清理功能會移除 Word 特定的 class 和內聯邊距,同時保留內容結構。

從 Word 貼上的圖片怎麼處理?

+

Word 有時會以 base64 data URI 或 VML 標記的形式嵌入圖片。Publish Helper 會保留標準的 img 標籤,但移除 Word 特定的 wrapper 和 VML 內容。建議將圖片另外上傳到您的 CMS 以獲得最佳效果。

Related Tools & Guides

Ready to clean your HTML?

Open Publish Helper

Last updated: March 2026

更新日誌

v2.2.02026-03-18
  • 新功能AI-Powered Title to SEO Slug — Convert blog titles in any language to SEO-friendly English slugs in under 10 seconds
  • 新功能Slug generator toggle on the main page — generate slugs right after editing, above the fold
  • 新功能Table support — pasted tables from Google Docs now render correctly
  • 新功能Remove <br> after headings cleanup option (on by default)
  • 新功能Partial text selection copy in the HTML code view
  • 新功能Sticky Clean HTML button at the bottom of the page
  • 改進Heading conversion now strips prefixes from existing heading tags and supports Chinese full-width colon (:)
  • 改進Shared footer across all pages
v2.1.22026-03-17
  • 修復Bug fixes and improvements
v2.1.12026-03-16
  • 修復Bug fixes and improvements
v2.1.02026-03-16
  • 新功能Formatted/Raw toggle for the HTML code view
  • 改進Copying from the code panel now always gives clean, unformatted HTML
v2.0.02026-03-16
  • 新功能Welcome to Publish Helper — free online tools for content editors
  • 改進Improved search engine visibility
v1.1.02026-03-16
  • 改進Clipboard copy — clean HTML output matches the code view
v1.0.02026-03-16
  • 新功能Rich text editor with Google Docs paste support
  • 新功能HTML cleanup: strip styles, classes, empty tags, and Google Docs artifacts
  • 新功能Heading conversion from text prefixes to proper HTML tags
  • 新功能Find & replace with regex support and saveable presets
  • 新功能Syntax-highlighted HTML preview with one-click copy