WordPress.org

Ready to get started?Download WordPress

Forums

HTML Editor is mangling my code (4 posts)

  1. MAVIC
    Member
    Posted 5 years ago #

    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 -

  2. 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

  • MAVIC
    Member
    Posted 5 years ago #

    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
    Member
    Posted 5 years ago #

    This is a "feature". If you find it as annoying as most other users, upvote http://wordpress.org/extend/ideas/topic.php?id=437

  • MAVIC
    Member
    Posted 5 years ago #

    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".

  • Topic Closed

    This topic has been closed to new replies.

    About this Topic

    Tags