[wp-trac] [WordPress Trac] #18311: Support HTML in image captions.
WordPress Trac
wp-trac at lists.automattic.com
Fri Feb 10 21:40:25 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 jeremyclarke):
Replying to [comment:31 azaozz]:
> That would also prevent the user from editing or inserting any HTML
there using MCE which is the main purpose if this improvement.
FWIW I think the main purpose of this improvement is to make it possible
to add links in captions, not that it be easy to do so using the WYSIWYG
tools. The bug is that it's impossible, whereas making it easy would be a
more of a new feature request (just like it would be a feature request to
give a way to add arbitrary CSS classes to HTML tags in the Visual editor,
unlike the ability to do so in the HTML editor without it being destroyed
when switching to Visual, which we already have).
> 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.
If we can make it work in the Visual editor then I think having some
encoded characters in the HTML editor is harder but not insanely so.
[caption] shortcodes are already hard to look at, this won't make it that
much worse.
> 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.
Asking users to "only use single quotes" strikes me as unlikely to be
successful and it also assumes the use of double-quotes throughout the
shortcode, which is how it gets generated by the uploader UI, but not at
all a prerequisite of the shortcode otherwise. In theory this could be a
partial solution if we could stop the Visual editor from destroying such
links (currently any links using single-quotes, as well as any subsequent
text in the caption is removed when you switch to visual).
I think on some level despite the fact that &39; is confusing it would
also make it clear that "this is complicated and not just plain HTML".
Using single quotes would make it look like any html could go in there,
but if people wrote html that seemed the same but with double-quotes it
would have very unpredictable effects (e.g, looking and working fine but
getting destroyed if you ever switch to Visual editor).
It's great to hear you're also working on the wpeditimage plugin. I'm
eager to try any patches you have that affect this situation. Thanks!
--
Ticket URL: <http://core.trac.wordpress.org/ticket/18311#comment:33>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list