In a perfect world, WordPress would take what I enter into the HTML editor and write it verbatim into the post/page document received by the browser. Disabling
wpautop has already helped me slightly to this end. Alas..
Setup: I write some HTML into the editor and click UPDATE. My post/page is formatted correctly, but the contents of my editor have changed:
br tags are gone, replaced respectively with actual empty lines and line breaks. When I view source, the contents of the editor
textarea are what I originally typed, but its as if
br tags are actually being rendered in the
The problem is that when I click UPDATE again (without changing anything), the post/page is formatted incorrectly, because said tags are lost.
How can I get my HTML editor contents not to be automatically mangled? I do not ever switch over to the visual editor. Just scanning through
wp-includes/formatting.php, the function
format_to_edit seems promising, but unsure how to proceed.
<p>Hello</p>in HTML editor for new post
- Click PUBLISH, published post is formatted correctly
- Contents of editor changed after the PUBLISH refresh to
Hello(p tags gone)
- Click UPDATE, post is formatted incorrectly due to lack of p tags
After looking at some of the comments/answers and doing some testing, this does look like a hackery side-effect. I can't repro in a fresh install of Roots. Here are the details of my install:
- Customized Roots theme, no hackery.
- Plugins: Akismet, Advanced Custom Fields, Custom Post Type UI, Google Analytics for WP