#23176 closed defect (bug) (fixed)
Inserting media with multiple newlines in caption breaks HTML
| Reported by: | jonieske | Owned by: | azaozz |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.5.1 |
| Component: | Media | Version: | 3.5 |
| Severity: | minor | Keywords: | has-patch |
| Cc: | Focuses: |
Description
Steps to reproduce:
- Open add media dialog in editor to insert image
- Select image, enter caption with multiple newlines, eg:
"one
two
three"
- Leave alt text field empty
- Insert image into post
- 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.
Attachments (2)
Change History (8)
#2
follow-up:
↓ 3
@
14 years ago
- Keywords has-patch added; needs-patch removed
- Milestone Awaiting Review → 3.5.1
Confirmed. Appears to be a regression. In 3.4.2, an empty alt attribute wasn't populated with caption.
Version 0, edited 14 years ago by
(next)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
I can reproduce this against trunk. Here's the HTML code that gets generated when inserting the image with a multi-line caption and no alt tag: http://cl.ly/image/3c0d253C3O3a