Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#28217 closed defect (bug) (fixed)

select tag added to each new option line in select list

Reported by: John_W_B Owned by: azaozz
Priority: normal Milestone: 4.0
Component: TinyMCE Version: 3.9
Severity: normal Keywords: has-patch needs-testing
Cc: Focuses: javascript

Description

Steps to reproduce

paste a
select list into Text editor. Switch to Visual.

each

<option>

line gets

<select>

tags automatically added, which breaks the form.

The problem does not arise if the option tags are not separated by line breaks: the line breaks trigger the addition of unwanted select tags (without any wpautop plugin present). The problem did not arise on WP 3.8.

Related issues #18534 #19630

Attachments (3)

28217.patch (1.5 KB ) - added by iseulde 12 years ago.
28217.2.patch (1.5 KB ) - added by azaozz 12 years ago.
28217.diff (362 bytes ) - added by kovshenin 12 years ago.

Download all attachments as: .zip

Change History (12)

@iseulde
12 years ago

#1 @iseulde
12 years ago

  • Focuses javascript added
  • Keywords has-patch added
  • Version 3.9.13.9

Not sure if this is the best solution, but it fixes it.
This is a 3.9 regression... :(

@azaozz
12 years ago

#2 @azaozz
12 years ago

  • Keywords needs-testing added
  • Milestone Awaiting Review4.0

Not sure how this worked in MCE 3.x. Also having line breaks inside <select>, adds <p>/<br> on the front end. Don't see a point in preserving the line breaks, better to remove them (MCE will strip all line breaks on getContent() anyways).

#3 @iseulde
12 years ago

#28175 was marked as a duplicate.

This ticket was mentioned in IRC in #wordpress-dev by DrewAPicture. View the logs.


12 years ago

#5 @DrewAPicture
12 years ago

  • Owner set to azaozz
  • Status newreviewing

@azaozz: What's left here?

#6 @azaozz
12 years ago

  • Resolutionfixed
  • Status reviewingclosed

In 29315:

Formatting: no <p> or <br> around <option> tags in both flavours of wpautop, make "selects" easier to read in the Text editor. Fixes #28217.

#7 @azaozz
12 years ago

In 29316:

Formatting: make the removal of white space around <option> greedy, see #28217.

@kovshenin
12 years ago

#8 @kovshenin
12 years ago

  • Resolution fixed
  • Status closedreopened

r29315 broke a unit test. See 28217.diff.

#9 @azaozz
12 years ago

  • Resolutionfixed
  • Status reopenedclosed

In 29328:

Tests Autop: remove <option> from the list of inline tags. It is valid only in specific context (<select>, <optgroup> or <datalist>) and should not be wrapped in <p>. Props kovshenin, fixes #28217.

Note: See TracTickets for help on using tickets.