• mdo

    (@mdo)


    All I have to say is what the hell?

    One of the things I did first when upgrading to WordPress 2 was to disable the rich-text editor. Never used it, not once. I think that this might have something to do with my pages and posts being messed up.

    Upon creating a new page or post, I publish it as normal. It all seems to go great, but WordPress seems to be adding paragraph (p) tags and line breaks (br) all over the place. You can imagine what this does to a site pretty easily.

    However, this is only on pages that have forms in them. What could be getting screwed up with publishing a page which has all standards-compliant code and no open tags?

    If you need more clarification, here’s the problem: I view the source code of a page with a form on it and within the form tag there are paragraph and line break tags wrapping around different form elements (i.e., the fieldset, legend).

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter mdo

    (@mdo)

    No one has had a similar problem?

    infocynic

    (@infocynic)

    I have the same problem. I will temporarily remove the auth_redirect() direcitve from my page and kindly ask that anyone visiting NOT submit the form… it’s still being rewritten anyway.

    https://infocynic.no-ip.org/arf-quoteboard/quoteboard-add-quote/

    View the Source. Scroll down to the form.

    The ONLY [p] tag in my source for that page is around the opening line “Please fill out…”

    For example, the “Author…” lines are [label][select][option]…[/select][/label][br /]

    in my source. I can work around this for now by carefully noticing where the breaks are added, but it’s definitely a bug.

    Tyssen

    (@tyssen)

    Same problem here. I thought it might have something to do with the editor, but even when I move the form to an include and use the runPHP plugin and call it in that way, it still comes out with extra [p]s and [br /]s.
    It’s only on a contact form I’ve created myself though – the comments form doesn’t have the problem. :/

    Tyssen

    (@tyssen)

    Going through and removing all the line breaks and tabs from my HTML helps eliminate most of the errors, but there’s still a couple where tags are being inserted in between tags with no spaces.

    Tyssen

    (@tyssen)

    The solution appears to be to remove the form from the_content() of the page or post and include it in the template that calls the page instead. You can either create a new template or use is_page to determine when to include the form.

    I still creat a <p> befor the <img />, any clue.
    With or without any form. What are creating them?

    I just clean all <p> and ! i wrote my code not wp. NAsty function wpautop

    in wp-include/function-formatting.php

    i comment lines:

    70 – $pee = preg_replace(‘/\n?(.+?)(?:\n\s*\n|\z)/s’, “<p>$1</p>\n”, $pee); // make paragraphs, including one at the end – THIS REMOVES <p> ARROUND MY <img /> BUT ACTIVATE OTHER IN LINE THAT CREATE <br :

    78 – if ($br) $pee = preg_replace(‘|(?<!)\s*\n|’, “\n”, $pee); // optionally make line breaks – THIS I ALSO COMMENT

    I NOW I FREE FROM GHOST TAGS
    One more thing just comment the 2 statements taht follow “// Space things out a little” this give a extra extra spaces between line, not visual just in code

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Added Paragraph, Line Break Tags’ is closed to new replies.