Forums

A bug with some <div> markups? (4 posts)

  1. baruchel
    Member
    Posted 5 years ago #

    Hi, I installed WordPress 2.1 and soon noticed the following behaviour, quite difficult to see because the "visual" result in a browser very often is right though the xhtml code becomes invalid.
    When inserting some markups in a page, either from the editor or as the result of some plugin (for instance the wp-contact-form) containing some <div> which contain some other markups like <img> or <form>, here is what happens.
    <div><img src= ... /></div> (correctly nested)
    becomes
    <div><p><img src= ... /></div> (not correctly nested)

    I must say that it still happens even if there is no carriage return at the points where the <p> is automatically inserted.
    In some other cases I also saw the ending </p> appear in the result of my displayed page with no beginning <p>, for instance my wp-contact-form puts a </form> at the end of its job, and looking at the source code of the result, I see </p></form> with no starting <p>.

    I looked around in the options; I disabled the feature for correcting XHTML from the editor though it has very certainly nothing to do, since the trouble appears "on the fly" at display time.

    Why?

  2. Otto
    Tech Ninja
    Posted 5 years ago #

    Known issue: http://trac.wordpress.org/ticket/3669

    You can patch it yourself from the info at that link, or wait for the next release.

  3. baruchel
    Member
    Posted 5 years ago #

    Thanks; much better but still a bug:
    look at wp-contact-form plugin and see how WP adds a closing P tag (without opening one) after the closing FORM tag (and before the largest DIV of the plugin).

  4. incertus
    Member
    Posted 5 years ago #

    Long discussion of this found here;
    http://wordpress.org/support/topic/101906?replies=44

    Using the patch did fix all the issues for me other then the fact that the p tag shouldn't have been there to start with. But in wp-includes/formatting.php commenting out line 66 (and line 67 if you applied the patch) seems to fix it all and hasn't seemed to break anything else yet on my local install.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags