Opened 3 years ago
Closed 3 years ago
#12335 closed defect (bug) (fixed)
wpautop() adds pee's around closing tag of HTML 5 block-level element figure
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | low | Milestone: | 3.0 |
| Component: | Formatting | Version: | 2.9.2 |
| Severity: | trivial | Keywords: | has-patch |
| Cc: | me@… |
Description
If you add a figure-element into a post, it will only be altered on the last line. The ending tag of a HTML 5 block-level element figure is delivered as <p></figure></p> while the rest of the block is not altered.
I found the line, where block-level elements are listed, and the figure element - as well as other upcoming HTML 5 elements - isn't listed there:
http://core.trac.wordpress.org/browser/trunk/wp-includes/formatting.php#L188
Attachments (5)
Change History (13)
springfeld — 3 years ago
comment:1
springfeld — 3 years ago
As you can see (in the second file I uploaded which is generated by pasting the content of the first file) wpautop also assigns a paragraph around the start-tag (<p><figure ...></p>) and not only to the closing one.
My mistake.
- Cc me@… added
- Owner set to rmccue
- Status changed from new to assigned
Sure can.
The elements are: section|article|aside|hgroup|header|footer|nav|figure|details
Attaching patch.
- Keywords has-patch added
Note: we'll probably need to add more exceptions for <video> and <audio> in the vain of the current <object> exception.

HTML 5 snippet to copy and paste into a post