Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#28217 closed defect (bug) (fixed)

select tag added to each new option line in select list

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

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 11 years ago.
28217.2.patch (1.5 KB) - added by azaozz 11 years ago.
28217.diff (362 bytes) - added by kovshenin 11 years ago.

Download all attachments as: .zip

Change History (12)

@iseulde
11 years ago

#1 @iseulde
11 years ago

  • Focuses javascript added
  • Keywords has-patch added
  • Version changed from 3.9.1 to 3.9

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

@azaozz
11 years ago

#2 @azaozz
11 years ago

  • Keywords needs-testing added
  • Milestone changed from Awaiting Review to 4.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
11 years ago

#28175 was marked as a duplicate.

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


11 years ago

#5 @DrewAPicture
11 years ago

  • Owner set to azaozz
  • Status changed from new to reviewing

@azaozz: What's left here?

#6 @azaozz
11 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

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
11 years ago

In 29316:

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

@kovshenin
11 years ago

#8 @kovshenin
11 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

r29315 broke a unit test. See 28217.diff.

#9 @azaozz
11 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

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.