[wp-trac] [WordPress Trac] #18311: Support HTML in image captions.

WordPress Trac wp-trac at lists.automattic.com
Fri Feb 10 20:07:27 UTC 2012


#18311: Support HTML in image captions.
--------------------------------------+-----------------------
 Reporter:  prettyboymp               |       Owner:  sushkov
     Type:  task (blessed)            |      Status:  assigned
 Priority:  normal                    |   Milestone:  3.4
Component:  Editor                    |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  ux-feedback dev-feedback  |
--------------------------------------+-----------------------

Comment (by azaozz):

 Been working on a patch for our 'wpeditimage' TinyMCE plugin for the last
 week or so. Don't think showing the raw HTML in the visual editor is
 acceptable (it is a ''visual'' editor). That would also prevent the user
 from editing or inserting any HTML there using MCE which is the main
 purpose if this improvement.

 The problem is that whatever works in the visual editor looks pretty bad
 in the HTML editor and vice versa. Having a string with `htmlspecialchars`
 as entities in the HTML is highly undesirable and a lot harder to edit in
 the HTML editor.

 The improvement on the TinyMCE side currently pulls all image captions
 "constructs" out of the DOM, serializes the nodes into HTML strings,
 creates the caption shortcode and then adds it back after the whole
 content has been serialized. Working on the DOM nodes instead of post-
 processing the HTML code with regex ensures that all tags in the captions
 are captured correctly.

 As far as parsing the caption shortcode in PHP is concerned it seems to
 work well when using single quotes in the HTML in the caption attribute.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/18311#comment:31>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list