OL Learn

Paste Word and cleanup HTML

Is there an easy way to remove all “style” attributes from template source?

If we copy/paste Word document we get a lot of junk code in sorce (comments, styles …). It would be nice if we could remove all attributes from that code with a single click. “Format->Style->Remove formatting” does not remove all style properties (it does not remove alignemt, table cell width, height, margins …). I would like to remove everyting except html tag name.

I know that we can “Past as plain text” but with that option all tables from Word would be lost.

Thanks

Hi @darkovuj,

A option is to copy+paste it, copy the HTML code in Source mode (Connect Designer) and to execute a Find and Replace in for example Nodepad++ to remove all the style attributes. For the Find and Replace you can make use of a Regular Expression, such like: style="(.*?)"

We are working on a Microsoft Word import feature. This is likely to arrive in OL Connect 2022.1.

For now, there are some online MS Word HTML cleaners that you could try.