Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#32616 closed defect (bug) (fixed)

HTML in Gallery Captions Not Rending in Visual Editor

Reported by: macmanx Owned by: azaozz
Priority: normal Milestone: 4.4
Component: TinyMCE Version: 3.9
Severity: normal Keywords: has-patch needs-testing
Cc: Focuses: javascript

Description

When a caption including HTML is added to a gallery image, the HTML is not rendered in the Visual editor and instead displays as plain text. See attached screenshot.

This is in contraction to regular image captions containing HTML which do render in the Visual editor.

Issue reproduced in WordPress 4.2.2 and 4.3-alpha-32724 with no plugins and the Twenty Fifteen theme.

Attachments (3)

Screen Shot 2015-06-11 at 11.47.30 AM.png (129.7 KB ) - added by macmanx 11 years ago.
screenshot of issue
32616.patch (457 bytes ) - added by polevaultweb 11 years ago.
32616.2.patch (1.7 KB ) - added by iseulde 11 years ago.

Download all attachments as: .zip

Change History (15)

@macmanx
11 years ago

screenshot of issue

#1 @ocean90
11 years ago

#32669 was marked as a duplicate.

#2 @ocean90
11 years ago

  • Focuses javascript added
  • Keywords needs-patch added
  • Milestone Awaiting ReviewFuture Release
  • Version trunk3.9

#3 @iseulde
11 years ago

  • Component EditorTinyMCE

@polevaultweb
11 years ago

#4 @polevaultweb
11 years ago

  • Keywords has-patch needs-testing added; needs-patch removed

Patch added to use the triple mustache to not HTML escape the caption

#5 @iseulde
11 years ago

  • Summary Gallery Captions Not Rending in Visual EditorHTML in Gallery Captions Not Rending in Visual Editor

#6 @polevaultweb
11 years ago

It would be great to get this patch tested @iseulde, @ocean90 :) It still applies cleanly.

#7 @SergeyBiryukov
11 years ago

  • Milestone Future Release4.4

#8 @SergeyBiryukov
11 years ago

Introduced in [27408].

I have a concern about unfiltered HTML, see comment:10:ticket:27574.

With 32616.patch, I was able to get a JS alert via the caption field. Single (non-gallery) image captions appear to handle this differently, could not trigger an alert there.

Last edited 11 years ago by SergeyBiryukov (previous) (diff)

This ticket was mentioned in Slack in #core by sergey. View the logs.


11 years ago

#10 @SergeyBiryukov
11 years ago

  • Owner set to iseulde
  • Status newassigned

Could you take a look?

@iseulde
11 years ago

#11 @iseulde
11 years ago

  • Owner changed from iseulde to azaozz
  • Status assignedreviewing

New patch, not sure if it's the best solution.

#12 @azaozz
11 years ago

  • Resolutionfixed
  • Status reviewingclosed

In 35341:

TinyMCE:

  • Sanitize and render HTML in captions when showing a gallery preview (wpView).
  • Encode/escape HTML entered in the text field in the wpLink dialog.

Props iseulde, kraftbj, jnylen0, shawarkhan.
Fixes #32616.

Note: See TracTickets for help on using tickets.