Keep HTML format when switching from Visual to HTML editor

I know exactly how you feel, and sadly this problem is rooted in the wordpress core code not in TinyMCE or due to browser compatility problems. I wrote a plugin that allows you to format html markup in the HTML editor, switch back and forth between it and the Visual tab without affecting the source code, and make changes in the Visual tab without breaking the original HTML formatting…

http://wordpress.org/extend/plugins/preserved-html-editor-markup/

It also preserves tabbed indentations – 4 spaces only 🙁 – and it enhances HTML5 compatibility.

The only “pitfall” is that it disables wpautop. I quote pitfall because some people hate that the editor wraps p tags around their content, as a result the Visual editor will use br tags for carriage returns instead – so you may need to adjust your stylesheets.

Enjoy!

Leave a Comment

tech