Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #18311, comment 28


Ignore:
Timestamp:
05/01/2012 01:12:37 AM (13 years ago)
Author:
nacin
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #18311, comment 28

    initial v1  
    3131Screenshot of the caption field from the Edit Image popup inside the Visual Editor:
    3232
    33 [[Image(http://simianuprising.com/wp-content/uploads/2012/02/tinyMCE-link-in-caption-editimage-screenshot.png)]]
     33http://simianuprising.com/wp-content/uploads/2012/02/tinyMCE-link-in-caption-editimage-screenshot.png
    3434
    3535This strikes me as the easier problem. We need to filter the existing caption to entity-decode it as much as possible before sending it to the popup, and upon saving the popup we need to run the same encoding procedure used when inserting an image from the uploader popup. I took at stab at doing this and ended up on {{{editimage.dev.js}}} but I just can't figure out what does what.
     
    4343This is a lot harder, and I don't even know where to start. Here's how it looks now:
    4444
    45 [[Image(http://simianuprising.com/wp-content/uploads/2012/02/tinyMCE-link-in-caption-screenshot1.png)]]
     45http://simianuprising.com/wp-content/uploads/2012/02/tinyMCE-link-in-caption-screenshot1.png
    4646
    4747This is very logical behavior because the WYSIWYG is just showing us what the HTML would look like when viewed on a post. The thing is that when we actually show it on a post, the caption content will be run through the {{{html_entity_decode()}}} first, making the link active instead of encoded, so ideally we should incorporate that logic into the behavior of the editor, just like the shortcode is already parsed out to have the grey box.