Email clients and browser editors each add their own markup: Outlook ships mso- properties, Gmail nests divs with dir and font-size, and some editors emit one div per line. This page covers the div tree, non-breaking spaces and quoted reply chains.
Editor:Generic rich-text editors: Gmail and Outlook compose, Apple Mail, and browser-based editors such as TinyMCE and CKEditor
Every rich-text editor has its own HTML generation quirks. Email clients like Outlook embed mso- properties and conditional comments. Gmail wraps content in deeply nested divs. CMS editors may inject shortcodes, custom attributes, or plugin-specific markup. The common thread is non-semantic, non-portable HTML that breaks when moved to a different platform.
Outlook adds mso- properties and conditional comments; Gmail wraps the body in nested <div dir="ltr"> elements with font-size:small on each level.
TinyMCE and CKEditor keep a limited tag set but often insert <span style> wrappers for colours and fonts, and may leave the editor's own class on the root block.
Visual editors frequently use <div> per line in older builds, or <br> runs for spacing inside a single paragraph — neither maps to a paragraph structure.
Email composition inserts for alignment and indentation, which survives cleanup as literal nbsp characters and defeats text comparison.
Reply threads carry blockquote wrappers with attribute-laden <div> chains, which can nest dozens of levels deep in a long thread.
Rich Text Editors Output
<div dir="ltr"><div style="font-size:small"><div><b style="font-size:14px">Introduction</b></div><div style="font-size:small"><br></div><div style="font-size:small">This is a paragraph with <b>bold text</b> and <i>italic text</i>.</div></div></div>
Clean HTML
<h2>Introduction</h2> <p>This is a paragraph with <strong>bold text</strong> and <em>italic text</em>.</p>
Copy the body from the email client, deleting the quoted thread first
Clean in Publish Helper to remove the div tree, dir attributes and mso- properties
Replace non-breaking spaces with ordinary spaces
Rebuild paragraph structure if the source emitted a div per line
Carries a div tree with dir and style attributes, plus the original signature block and any quoted thread beneath it.
Carries mso- properties and conditional comments, like Word, because Outlook uses the same HTML engine.
Usually the cleanest email flavour: <p> and <br> with few attributes, but it can include inline font declarations from the message's formatting.
Drops all markup, including structure. Good for a fresh start, bad when the source has lists or headings you wanted to keep.
Quoted replies are part of the copied fragment. Delete from the first “On … wrote:” marker downwards, and clean what remains so the blockquote chain does not survive.
Those are non-breaking spaces inserted by the email composer. Replace with ordinary spaces before publishing, otherwise justify and wrapping behave strangely.
Some editors emit a div per line instead of paragraphs. Convert consecutive text-level divs into paragraphs, or paste as plain text and re-apply structure.
The generic rich-text category exists because email is where most publishing content actually starts. Writers draft in Gmail, forward in Outlook, and paste into a CMS — and each hop adds a layer of client-specific markup. Outlook is the worst offender because it shares Word's HTML engine, so a reply carries mso- properties that were never meant for a browser.
Gmail's contribution is structural rather than stylistic: a nested div tree with dir="ltr" at each level, font-size:small repeated per level, and used for alignment. Nothing in that tree is a paragraph, so a cleanup pass has to rebuild the block structure, not just strip attributes. That is why plain-text paste plus re-formatting is sometimes faster than trying to salvage the tree.
Yes. Publish Helper strips the div trees, mso- properties, conditional comments and inline styles that email clients add. Remove the quoted thread first, then clean the body you actually want to publish.
Gmail's composer builds the message as nested layout divs, with dir and font-size repeated per level. Each visual indentation is a div, so a few paragraphs can produce a dozen levels of nesting.
Yes. Paste content from Gmail, Outlook, Apple Mail, or any email client into Publish Helper. The cleanup pipeline strips email-specific wrappers, inline styles, and conditional comments.
Publish Helper works with content from any source. If you're migrating content from one CMS to another, paste the HTML into the editor and clean it to remove platform-specific markup before importing into your new system.
Yes. If your document contains paste from multiple sources (for example, a Google Docs draft with an email excerpt), Publish Helper processes all the HTML uniformly, removing all non-semantic markup regardless of origin.
Last updated: March 2026