Opened 15 years ago
Closed 13 years ago
#11947 closed defect (bug) (fixed)
wpautop inserts line break elements in select element breaking XHTML 1.1 Strict compatibility
Reported by: | akerem | Owned by: | |
---|---|---|---|
Milestone: | 3.0 | Priority: | low |
Severity: | normal | Version: | 2.9.1 |
Component: | Formatting | Keywords: | has-patch |
Focuses: | Cc: |
Description
The wpautop function of Wordpress inserts line break elements (<br />) after option elements in a select element of a form, breaking XHTML 1.1 Strict compatibility.
The problem can be solved simply by adding option to $allblocks variable in formatting.php
A diff file is attached.
Attachments (2)
Change History (10)
#3
@
14 years ago
Confirmed bug in trunk:
$in = "<select> <option>Value</option> </select>"; $out = wpautop($in); var_dump($out); ?> string '<select> <option>Value</option><br /> </select> ' (length=48)
Results after:
string '<select> <option>Value</option> </select> ' (length=48)
Note: If anyone is confused, that patch is reversed, Its the addition of option, not the removal.. had me perplexed for a moment there.
#5
follow-up:
↓ 7
@
13 years ago
- Cc Ken@… added
- Keywords changed from wpautop, line break, form, select, option to wpautop line break, form, select, option
- Resolution fixed deleted
- Status changed from closed to reopened
(Tested on 3.3-aortic-dissection)
The PHP version is fixed, but not the JavaScript version (Everyone always forgets the poor JavaScript version). Try in HTML Tab:
<select> <option>Value</option> <option>Value</option> <option>Value</option> <option>Value</option> <option>Value</option> </select>
Then switch to Visual and Back. The result is:
<select> <option>Value</option></select> <select> <option>Value</option></select> <select> <option>Value</option></select> <select> <option>Value</option></select> <select> <option>Value</option></select>
There are other fixes (I'm sure) that got applied to the php wpautop, but not the JavaScript version. Sadly, TinyMCE's reputation might be taking a beating over stuff like this ;-)
#6
@
13 years ago
- Keywords changed from wpautop line break, form, select, option to wpautop line break form, select, option
related #18514
#7
in reply to:
↑ 5
@
13 years ago
- Keywords has-patch added; wpautop line break form select option removed
- Milestone changed from 3.0 to 3.3
Replying to WraithKenny:
The PHP version is fixed, but not the JavaScript version
In 11947.patch I've synchronized block tags between formatting.php
and editor.dev.js
, which fixes the issue with <select>
.
Isn't it better to open a new ticket for it though? I was under impression that tickets from a completed milestone generally shouldn't be reopened.
Diff file for formatting.php