Make WordPress Core

Opened 17 years ago

Closed 12 years ago

#10645 closed defect (bug) (worksforme)

auto_p and forms

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

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
17 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
16 years ago

  • Keywords needs-patch added
  • Milestone Unassigned3.0

#3 @dd32
16 years ago

  • Keywords wpautop added
  • Milestone 3.03.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
16 years ago

  • Milestone Awaiting TriageFuture Release
  • Priority normallow

#5 @chriscct7
12 years ago

  • Keywords needs-unit-tests added

#6 @ericlewis
12 years ago

  • Keywords needs-patch needs-unit-tests removed
  • Milestone Future Release
  • Resolutionworksforme
  • Status newclosed

Cannot reproduce with

 HTML
<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>
Note: See TracTickets for help on using tickets.