• Resolved d00dlz

    (@d00dlz)


    I’ve been using the WP html editor (I have the “use visual editor” checkbox unchecked in my users options) and it has been inserting unnecessary closing p elements directly before my correct closing div tags. My code won’t validate because of this.

    I read a few posts and tried deleting this: p/-div[*], from this line:

    $valid_elements =
    ‘p/-div[*],-strong/-b[*],-em/-i[*],-font[*],-ul[*],-ol[*],-li[*],*[*]’;

    in the wp-includes/js/tinymce/tiny_mce_config.php file.

    It’s still adding the unnecessary closing p element.

    Not sure what to do next. Has anyone experienced this?

Viewing 9 replies - 1 through 9 (of 9 total)
  • If you insert your own html tags/code – turn OFF completely the visual/wysiwyg and NEVER turn it on.

    The wysiwyg is for code illiterates who just type text. Decide where do you belong and act accordingly: you cannot have both.

    And if you use the “code” editor – do NOT hit enter twice before your divs. Hitting Enter 2x = paragraph.

    Thread Starter d00dlz

    (@d00dlz)

    I did turn it off, though. Unless I missed a step in turning it off. I deselected the visual editor checkbox, like I said before. Is there some other way to turn it off?

    And there are absolutely no spaces around my divs. Should I “clump” the code together so it all runs together as one line? Would that help? It makes it harder for me to read, but I guess if it would work.

    Since you were talking about tinymce files… I didn’t notice that it was turned off. If it is turned off – leave the tinymce files alone.

    Any plugins turned on that may affect your output?

    Thread Starter d00dlz

    (@d00dlz)

    Yes, it works when I put the divs on the same lines as the ps. Sorry I should have realized this earlier.

    Furthermore: fix your permalinks on the blog: http://tracystoneart.com/blog/
    and then give a direct link to a post that doesn’t keep the formatting.

    Thread Starter d00dlz

    (@d00dlz)

    Okay, so far it works when I make sure the closing div comes directly after the closing p. Like this:

    <div>
    <p>blah blah.</p></div>
    <div>
    <p>blah blah.</p></div>

    I’ll post a direct link to a post if anything should go wrong again. Thanks for your help.

    The html editor interprets
    Enter x 1 = br
    Enter x 2 = p

    Thread Starter d00dlz

    (@d00dlz)

    Right, I see now, thanks!

    There’s a great plugin which wraps code with a comment to prevent the code from being altered by the html editor. It’s at http://w-shadow.com/blog/2007/12/13/raw-html-in-wordpress/ and works in 2.6.2.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘html editor adding </p> before </div>’ is closed to new replies.