[wp-trac] [WordPress Trac] #6451: In html form,
WP adds (/p) instead of (br /)
WordPress Trac
wp-trac at lists.automattic.com
Sat Mar 29 18:33:01 GMT 2008
#6451: In html form, WP adds (/p) instead of (br /)
----------------------+-----------------------------------------------------
Reporter: PozHonks | Owner: anonymous
Type: defect | Status: new
Priority: normal | Milestone: 2.5.1
Component: General | Version: 2.5
Severity: normal | Keywords: html form rendering
----------------------+-----------------------------------------------------
In a form, when there should be a line break, instead of
adding "<br />", WP adds "</p>". But
there is no beginning "<p>". So, the layout of the form is a mess! But,
I think it is a bit more complicated, sometimes there is a <br/ >
See picture here:
<http://demo21.ovh.com/5bfed4cf73c151b9fc0f6b5e71f4bc87P/?see=rendering-
form-RC3.png>
After "name:" there should be a line break, the checkbox should be in
a new line, etc.
Excerpt of the genuine code displayed in the wordpress admin area
(with the good line breaks):
-------------------
{{{
<form action="/cgi-bin/mail.cgi" method="post">
<label><strong>Name:</strong></label>
<input maxlength="80" name="name" size="40" type="text" /> * <span
style="color: #006633; font-size: small;">required</span>
<label><strong>E-mail:</strong></label>
<input maxlength="80" name="email" size="40" type="text" /> * <span
style="color: #006633; font-size: small;">required</span>
<input name="confirmation_message" type="checkbox" value="1"
/><strong>Receive a copy of this message to your e-mail
address</strong>.
<label><strong>Subject:</strong></label>
<input maxlength="80" name="subject" size="40" type="text" /> * <span
style="color: #006633; font-size: small;">required</span>
<label><strong>Message:</strong></label>
<textarea style="width:450px;" cols="55" rows="15"
name="message"></textarea>
<input style="font-size:1.5em;" name="submit_form" type="submit"
value=" SEND IT " />
</form>
}}}
-------------------
Now, the html code interpreted by WP 2.5 :
-------------------
{{{
<form action="/cgi-bin/mail.cgi" method="post">
<label><strong>Name:</strong></label></p>
<input maxlength="80" name="name" size="40" type="text" /> * <span
style="color: #006633; font-size: small;">required</span></p>
<p><label><strong>E-mail:</strong></label></p>
<input maxlength="80" name="email" size="40" type="text" /> * <span
style="color: #006633; font-size: small;">required</span></p>
<input name="confirmation_message" type="checkbox" value="1"
/><strong>Receive a copy of this message to your e-mail
address</strong>.</p>
<p><label><strong>Subject:</strong></label></p>
<input maxlength="80" name="subject" size="40" type="text" /> * <span
style="color: #006633; font-size: small;">required</span></p>
<p><label><strong>Message:</strong></label><br />
<textarea style="width:450px;" cols="55" rows="15"
name="message"></textarea></p>
<input style="font-size:1.5em;" name="submit_form" type="submit"
value=" SEND IT " />
</form>
}}}
-------------------
If some </p> after </label> are replaced by <br>, everything should be
fine.
Using WP 2.5, Firefox 3.0b4, Mac 10.5.2.
Safari 3.1 displays a better result by fixing this bug, interpreting
the lonely </p> as a <br />, but the source code, is still wrong.
--
Ticket URL: <http://trac.wordpress.org/ticket/6451>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list