Forums

2.8 HTML editor adding <p> and <br /> (9 posts)

  1. eight7teen
    Member
    Posted 5 months ago #

    Ok, so I haven't used the visual editor in so long that I don't even remember what it looks like... So we know that's not the issue.

    I ONLY use the HTML editor and I write my own <p> tags and <br /> and so forth... The problem I'm running into now after upgrading to 2.8 is that each time I use a special <span> with custom styling that I've made, WP is adding a <p> around that span as well as a <br /> after the paragraph.

    I'm also noticing that there are extra <br /> being added beneath images that I insert into the post...

    It's completely screwing up the look of the post and it's beginning to piss me off.

  2. esmi
    Member
    Posted 5 months ago #

    <span> is an inline element (no matter how it's styled) and should still be enclosed in a block level element such as <p> or <div>. So WP is actually acting correctly and in line with the relevant W3C specs. Try placing your span blocks inside unstyled div tags. That will stop the auto-addition of paragraph markup.

    As for the break tags after images, I've not noticed that myself and I use the HTML tab all of the time.

  3. eight7teen
    Member
    Posted 5 months ago #

    I'm noticing that if I use an image in my posts/pages, WP is wrapping the image with a <p> tag and then adding a <br /> after the image...

    So instead of the markup looking like:

    <img src="blah.jpg" alt="" />

    It winds up coded like this:

    <p>
    <img src="blah.jpg" alt="" />
    <br />
    </p>

    That is ridiculous...

  4. soydevon
    Member
    Posted 4 months ago #

    Is there any further news on this? I'm suddenly noticing this same problem on a couple of websites that NEED to be 100% validated code. WP is messing up the validation completely by adding in code.

    Even weirder, the code isn't even showing up in the editor, but will show up in the webpage output. Huh?!? I upgraded to 2.8.2 hoping it would fix this issue, but it didn't. What gives? I too, never use the visual editor.

  5. sorenmacbeth
    Member
    Posted 4 months ago #

    I'm having this same issue. It makes it impossible to run google website optimizer tests. They require <script></script> and </noscript> blocks in the body and even with the visual editor and allow wordpress to correct XHTML settings disabled, they tags get wrapped in <p></p>

    HALP!

  6. esmi
    Member
    Posted 4 months ago #

    Enclose the <script></script> and </noscript> blocks inside `<div></div>' tags.

  7. eight7teen
    Member
    Posted 4 months ago #

    I found a solution by using the following plugin:

    http://wordpress.org/extend/plugins/raw-html/

    Hope it helps you guys as well...

  8. powerkor
    Member
    Posted 3 months ago #

    Very annoyed with this! Fix this s**t how hard is it to not add html? Is there a plain editor option? aka non-filtered?

  9. chillstarr
    Member
    Posted 2 weeks ago #

    I agree, this is really annoying for many layouts. It has been breaking mine all day.
    I found this which is simple & works a treat:
    http://www.web-strategy.jp/wp_plugin/ps_disable_auto_formatting/

Reply

You must log in to post.

About this Topic