WordPress.org

Forums

[closed] Hey WordPress STOP Screwing up my HTML in my posts! (23 posts)

  1. Yeago
    Member
    Posted 8 years ago #

    Ok, this is an issue that never seems to die, and never seems to get answered properly.

    Just to clear things up, I am >NOT< using the Visual editor.

    When I attempt to insert the following html into my post..

    http://pastebin.com/m3b218a28

    ....it comes out like this...

    http://pastebin.com/m58d1ce20

    Notice the extra <p> around my fieldset. Also notice all the < br >s! Stop helping me WordPress!

    Ok, seriously, and for serious. For once, for final, for the internet, all children, and all humanity, how do you make WordPress STOP doing this?

    PS: Yes, I tried removing all returns. Same result.

  2. Root
    Member
    Posted 8 years ago #

    We know. It sucks. And we share your pain.

  3. microkid
    Member
    Posted 8 years ago #

    If you want to add something like a form, it's maybe easier to make a template file with the form in it, and then attach it to a new page.

  4. Chris_K
    Member
    Posted 8 years ago #

    Your search-fu is weak, grasshopper. ;-)

    http://wordpress.org/support/topic/103621?replies=8#post-509836 is one result I turned up that might interest you.

    The function you're wrestling with is called autop (mentioned in most posts a search would turn up on this "issue"). It becomes a great search keyword.

    Hope that helps a bit.

  5. Yeago
    Member
    Posted 8 years ago #

    Microkid, for the sake of the endless hoards who share the same problem, coould you be a little more specific?

    ps: Its just an example form, not a real one.

  6. Yeago
    Member
    Posted 8 years ago #

    HandySolo, disabling wpautop seems interesting but isn't this an obvious BUG? Why on earth would WP insert Ps around things it *knows* are html tags?

  7. whooami
    Member
    Posted 8 years ago #

    Bug has a very specific definition when used in the context of software development - and by that definition, no,its not a bug. Its a behaviour.

  8. Yeago
    Member
    Posted 8 years ago #

    Nah, its a bug. I'm looking at the function myself and it makes exceptions for all kinds of html tags. The fact that it treats fieldsets like regular ol' text dirt is called one thing: BUG.

  9. whooami
    Member
    Posted 8 years ago #

    whatever .. I dont care.

  10. Yeago
    Member
    Posted 8 years ago #

    I'm gonna take it to a more technical channel.

    If anyone finds that p tags are fudging up their code, and you're a brave code-naut you can open up wp-includes/functions-formatting.php and look at the function wpautop. To fix this I simply did:

    find and replace the word 'select'

    replace 'select' with 'select|*tagsYourHavingProblemWithSeparatedByPipes*'

    PS: On versions other than 2.0.3 I can't help if you mess something up.

  11. Yeago
    Member
    Posted 8 years ago #

    Here's my fix:

    http://yeago.net/works/problem-issue-with-wordpress-messing-up-html-with-p-and-br-tags

    I'll talk to wp developers and see if they're interested in incorporating it in future versions.

  12. microkid
    Member
    Posted 8 years ago #

    Read about Page Templates.

    Create a page template that contains a form. Then, in your wp-admin section write a new page, and under "Page Template" select the template file with the form.

  13. microkid
    Member
    Posted 8 years ago #

    You have to understand that the textfield in WordPress is for adding content, as in text. In this approach fieldsets are indeed dirt, and they need to be filtered out when someone accidentally copy-pasted them from another website. So there is no bug, and right now you are blaming wordpress for your lack of effort in RTFM.

  14. Yeago
    Member
    Posted 8 years ago #

    Who's text are you talking about? If you're talking about regular users, fine and dandy, but the fieldset is a popular tag for developers for vision-impaired users. It is a text or form-input grouping element.

    I see what you mean and thank you for clarifying why some html tags are ignored by wpautop. I see its not arbitrary.

    However, in the current case they aren't "filtered out". They are simply messed up with paragraph tags--not necessarily even disabled or non-functional, just non-standard and pesky. I think the fact that the community created a 'disable wpautop' plugin could be taken as a sign that the wpautop function is considered non-functional in its current state to a large slice of users.

  15. whooami
    Member
    Posted 8 years ago #

    This is semo-off topic, but ...

    I think the fact that the community created a 'disable wpautop' plugin could be taken as a sign that the wpautop function is considered non-functional in its current state to a large slice of users.

    Thats an absolutely nonsensical argument -- theres a 'reverse all the text" plugin too.

    The fact is that wpautop works for some and doesnt for others - myself,I enable/disable it on a post per post basis, AS needed.

  16. Yeago
    Member
    Posted 8 years ago #

    Sorry you find it nonsensical. I think that among bloggers who post a lot of html you'd find a lot of disagreement--especially if the vast amount of support posts about this topic is an indication. What's funny is I think wpautop is quite useful as I don't want to bother with typing p and br. However, I'm hard pressed (and have as yet received no reason) why you'd need a p or a br between any html tags, text or otherwise. With a little more constructive discussion about the logic of the wpautop function I'd say it could serve all without any fuss.

  17. whooami
    Member
    Posted 8 years ago #

    ...why you'd need a p or a br between any html tags, text or otherwise.

    to do exactly what they are intended to do? I use p and br tags all of the time, even IF i have disabled wordpress' text formatting?

    I can almost understand why you might haggle over the p, but a single line break? pfft.

  18. Yeago
    Member
    Posted 8 years ago #

  19. here
    Member
    Posted 7 years ago #

    Attempt at collecting information on related issues:

    http://codex.wordpress.org/How_Wordpress_Processes_Entry_Text

  20. moshu
    Member
    Posted 7 years ago #

    Instead of reviving 4 months old posts... turn off the wysiwyg editor and your code will remain as you entered.
    Turn off means do NOT switch between code and visual - in that case the wysiwyg is always ON!

  21. Shaliza
    Member
    Posted 7 years ago #

    I knew about turning off the editor from the start, but I still have two paragraphs where I don't want them.

  22. Yeago
    Member
    Posted 7 years ago #

    Instead of reviving 4 months old posts... turn off the wysiwyg editor and your code will remain as you entered.

    No, actually that's not true. READ UP PLEASE. This is disinfo.

  23. This thread is no longer productive. If you have specific suggestions to fix autop, then take them to trac. If you want to disable it, there's a plugin. Beyond that, stop arguing about it.

    Closed.

Topic Closed

This topic has been closed to new replies.

About this Topic