WordPress.org

Make WordPress Core

Opened 5 years ago

Last modified 3 years ago

#10645 new defect (bug)

auto_p and forms

Reported by: kingjeffrey Owned by:
Milestone: Future Release Priority: low
Severity: normal Version:
Component: Formatting Keywords: needs-patch 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 (4)

comment:1 kingjeffrey5 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>`

comment:2 scribu4 years ago

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

comment:3 dd324 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.

comment:4 nacin3 years ago

  • Milestone changed from Awaiting Triage to Future Release
  • Priority changed from normal to low
Note: See TracTickets for help on using tickets.