WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. eight7teen
    Member
    Posted 5 years 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
    Forum Moderator
    Posted 5 years 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 years 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 5 years 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 5 years 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
    Forum Moderator
    Posted 5 years ago #

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

  7. eight7teen
    Member
    Posted 4 years 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 4 years 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 4 years 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/

  10. h4n1
    Member
    Posted 4 years ago #

    haha. this is such a joke. still does it in 2.8.6. even wraps my comments in paragraph tags. thanks wordpress!

  11. oliver c kerr
    Member
    Posted 4 years ago #

    To start, I am a newbie who knows basic html sort of. I am also an independent candidate for president of United states. Month of November I had 900 unique visitors and 54,000 hits. the site: http://michaelslevinson.com

    I have uploaded word press to my hostmonster server via simple scripts. The tech guy @ Hostmonster said I have to upgrade the html.

    I truly do not know what to do, nor can I afford to pay anyone. What I want to have happen is at the end of every page a message / post box like this one I am typing into, so a visitor can comment on a page's contents, ask me a question, etc.

    What do I have to do to make that happen? I like the way the home page looks and though i don't have a template for the linked pages I sort of made it up as I went along. But I need a hand. Someone guide me what do I have to do?

    Thanks

    michael s levinson (oliver c kerr)

  12. zaclondon
    Member
    Posted 4 years ago #

    Thanks the posting those plugin details eight7teen and chillstarr. Both http://wordpress.org/extend/plugins/raw-html/ and http://www.web-strategy.jp/wp_plugin/ps_disable_auto_formatting/ works to disable auto formatting, but the latter is easier to use so I settled with that. Thanks!

  13. alexsix
    Member
    Posted 4 years ago #

    I'm having the same probelm when in visual mode of page editor. I just posted a topic on it. I'm using 2.9.2 and this does not happen on all pages, just every so often.
    http://wordpress.org/support/topic/402273

  14. billwandel
    Member
    Posted 4 years ago #

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

    This plugin the holy grail of wordpress. Thanks for posting this! It solved all my html issues. I will never write another post without enclosing it in RAW brackets.

Topic Closed

This topic has been closed to new replies.

About this Topic