Title: HTML Editor is mangling my code
Last modified: August 19, 2016

---

# HTML Editor is mangling my code

 *  [MAVIC](https://wordpress.org/support/users/mavic/)
 * (@mavic)
 * [17 years, 1 month ago](https://wordpress.org/support/topic/html-editor-is-mangling-my-code/)
 * I’m building out a data grid using lists that I’ve set to display as table rows
   and table cells.
 * Some of the cells have no data, so I have them as an empty set of list items.
   This makes the columns and rows line up correctly. It looks like this:
 *     ```
       <ul>
       	<li>Row 1</li>
       	<li>x</li>
       	<li>x</li>
       	<li>x</li>
       	<li>x</li>
       </ul>
       <ul>
       	<li>Row 2</li>
       	<li>x</li>
       	<li></li>
       	<li>x</li>
       	<li>x</li>
       </ul>
       ```
   
 * When I publish that, WP strips out the empty list item –
    - So then I thought I would add a non-breaking space in there. The first time
      I publish it, WP removes the nbsp leaving an empty set. Then the next time
      I publish it, WP removes the empty set.
    - I have “WordPress should correct invalidly nested XHTML automatically” unchecked.
    - How do I get WP to leave my HTML alone?
    - I’m using 2.7.1.
    - Thanks

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [MAVIC](https://wordpress.org/support/users/mavic/)
 * (@mavic)
 * [17 years, 1 month ago](https://wordpress.org/support/topic/html-editor-is-mangling-my-code/#post-1062843)
 * Anyone? I’m running into yet another instance where WP thinks it knows how to
   write code better than I do. This time I just want to align an image to the left
   of a paragraph, but it keeps stripping out my formatting. It’s all xhtml strict
   code.
 *  [brainycat](https://wordpress.org/support/users/brainycat/)
 * (@brainycat)
 * [17 years, 1 month ago](https://wordpress.org/support/topic/html-editor-is-mangling-my-code/#post-1062844)
 * This is a “feature”. If you find it as annoying as most other users, upvote [http://wordpress.org/extend/ideas/topic.php?id=437](http://wordpress.org/extend/ideas/topic.php?id=437)
 *  Thread Starter [MAVIC](https://wordpress.org/support/users/mavic/)
 * (@mavic)
 * [17 years, 1 month ago](https://wordpress.org/support/topic/html-editor-is-mangling-my-code/#post-1062849)
 * Thanks much. They should at least quit calling it the “HTML” editor if it doesn’t
   let you edit the HTML and just their own bastardized version of it. At least 
   Microsoft calls their excuse for HTML “MSHTML”.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘HTML Editor is mangling my code’ is closed to new replies.

## Tags

 * [code](https://wordpress.org/support/topic-tag/code/)
 * [html editor](https://wordpress.org/support/topic-tag/html-editor/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [MAVIC](https://wordpress.org/support/users/mavic/)
 * Last activity: [17 years, 1 month ago](https://wordpress.org/support/topic/html-editor-is-mangling-my-code/#post-1062849)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
