WordPress.org

Make WordPress Core

Opened 11 years ago

Closed 6 years ago

#10645 closed defect (bug) (worksforme)

auto_p and forms

Reported by: kingjeffrey Owned by:
Milestone: Priority: low
Severity: normal Version:
Component: Formatting Keywords: wpautop
Focuses: Cc:

Description

auto_p will errantly injects paragraph and linebreak tags in certain circumstances within forms:

`<div>
<label for="select_element">This is a select box placed <select name="select_element"><option value="1">inline</option</select> with the label.</label>
</div>`

becomes:

`<div>
<label for="select_element">This is a select box that is pla­ced<br />
<select name="select_element"><option value="1">inline</option><option value="2">inside</option><option value="3">within</option></select>

<p>inline with the label.</label>
</div>`

linebreak and paragraph tags should never be inserted inside a label. In this case they are not even properly paired. It would be nice if the surrounding div was identified and no tags were inserted, although if a paragraph tag wrapped the whole thing, it would not be the end of the world.

Change History (6)

#1 @kingjeffrey
11 years ago

The resulting code was clearly mis-typed. It should have been:

`<div> <label for="select_element">This is a select box that is pla­ced<br /> <select name="select_element"><option value="1">inline</option></select>

<p>inline with the label.</label> </div>`

#2 @scribu
11 years ago

  • Keywords needs-patch added
  • Milestone changed from Unassigned to 3.0

#3 @dd32
11 years ago

  • Keywords wpautop added
  • Milestone changed from 3.0 to 3.1

Bumping to 3.1, There are a bunch of tickets related to this which need proper test-cases so we can fix all of these sort of bugs together.

#4 @nacin
10 years ago

  • Milestone changed from Awaiting Triage to Future Release
  • Priority changed from normal to low

#5 @chriscct7
6 years ago

  • Keywords needs-unit-tests added

#6 @ericlewis
6 years ago

  • Keywords needs-patch needs-unit-tests removed
  • Milestone Future Release deleted
  • Resolution set to worksforme
  • Status changed from new to closed

Cannot reproduce with

with the label.
Note: See TracTickets for help on using tickets.