Inserting media with multiple newlines in caption breaks HTML
|Reported by:||jonieske||Owned by:||azaozz|
Steps to reproduce:
- Open add media dialog in editor to insert image
- Select image, enter caption with multiple newlines, eg:
- Leave alt text field empty
- Insert image into post
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.
Remove newlines from content that is automatically inserted to alt attribute.
Change History (8)
comment:2 follow-up: ↓ 3 @SergeyBiryukov — 2 years ago
- Keywords has-patch added; needs-patch removed
- Milestone changed from Awaiting Review to 3.5.1
- Owner set to azaozz
- Resolution set to fixed
- Status changed from new to closed