[wp-trac] [WordPress Trac] #23176: Inserting media with multiple newlines in caption breaks HTML
WordPress Trac
noreply at wordpress.org
Fri Jan 11 07:57:22 UTC 2013
#23176: Inserting media with multiple newlines in caption breaks HTML
-----------------------------+--------------------------
Reporter: jonieske | Type: defect (bug)
Status: new | Priority: normal
Milestone: Awaiting Review | Component: Media
Version: 3.5 | Severity: minor
Keywords: |
-----------------------------+--------------------------
Steps to reproduce:
1. Open add media dialog in editor to insert image
2. Select image, enter caption with multiple newlines, eg:
"one[[BR]]
two[[BR]]
three"
3. Leave alt text field empty
4. Insert image into post
5. Save/Update
As a result, HTML code breaks and image isn't displayed. This happens
because caption is inserted to alt attribute in case it's empty, and
newlines break the markup. Toggling between text and visual modes before
initial post save fixes the code though.
Proposed fix:
Remove newlines from content that is automatically inserted to alt
attribute.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/23176>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list