Make WordPress Core

Opened 14 years ago

Closed 10 years ago

Last modified 10 years ago

#11674 closed defect (bug) (worksforme)

Caption Short Codes Don't Work

Reported by: miqrogroove's profile miqrogroove Owned by:
Milestone: Priority: normal
Severity: critical Version:
Component: TinyMCE Keywords: needs-patch
Focuses: Cc:


I'm testing 2.9.1-RC1 now. If I create a post, add a gallery plus a captioned image beneath it, this is what shows up in the HTML editing view:

<div class="mceTemp">


<dl id="attachment_80" class="wp-caption alignnone" style="width: 160px;"><dt class="wp-caption-dt"><a rel="attachment wp-att-80" href="mytestsite/2009/12/test-post-3/wp-exif-bug/"><img class="size-thumbnail wp-image-80" title="This is a supercool test" src="mytestsite/wp-content/uploads/2009/12/wp-exif-bug-150x136.jpg" alt="" width="150" height="136" /></a></dt><dd class="wp-caption-dd">Caption goes here</dd></dl></div>

Change History (9)

#1 @miqrogroove
14 years ago

Additional symptoms:

Orphaned </div> tags
Some images disappear when switching to HTML view
Cursor at right side of image gives Path: div.mceTemp > div.mceTemp > dl.wp-caption alignnone

#2 follow-up: @miqrogroove
14 years ago

Steps to reproduce:

  1. Insert captioned image into new post.
  1. Move cursor to top of post.
  1. Insert gallery.
  1. Enjoy the fail.

#3 in reply to: ↑ 2 @azaozz
14 years ago

  • Component changed from Shortcodes to Editor
  • Milestone 2.9.1 deleted
  • Resolution set to wontfix
  • Severity changed from critical to trivial
  • Status changed from new to closed
  • Version 2.9 deleted

Replying to miqrogroove:

Steps to reproduce:

  1. Insert captioned image into new post.
  1. Move cursor to top of post.

No, the browsers don't allow that. You cannot move the cursor before the first element. This is one of several "oddities" when the browser is in designMode - cursor placement. The list of these glitches is quite long and browser and version dependent.

This is a rare case. What you're actually doing is inserting a [gallery] shortcode in the middle of an image caption and breaking it.

Don't see what WordPress can do through TinyMCE to fix the inadequate designMode in the browsers. This ticket is either "wontfix" or maybe "far in the future release" that could be addressed after all browsers decide to improve their support for live editing of HTML.

In any case certain tasks in the editor have to be completed in certain way to achieve certain results, same as in all software applications.

To reproduce:

  1. Insert captioned image into new post.
  2. Insert gallery.
  3. Enjoy your new post with an image above the gallery.

#4 @miqrogroove
14 years ago

  • Milestone set to 2.9.1
  • Resolution wontfix deleted
  • Severity changed from trivial to critical
  • Status changed from closed to reopened

This is reproducible when the cursor is not before the first element.

#5 @miqrogroove
14 years ago

azaozz, I hope I can follow up on this ticket with some questions about TinyMCE.

Regardless of whether the [caption] is the "first element" of the design area, the cursor appears to be "inside" of an mceTemp element. That mceTemp element is part of the [caption] code, correct? Doesn't that mean WordPress is effectively dropping the [gallery] short code into the middle of an HTML blob where it doesn't belong? I don't see how that has anything to do with cursor placement. I'm sure I can put the cursor in all sorts of weird places where a [gallery] tag would generate broken HTML if not handled correctly by WordPress. That's not a browser bug, that's a broken code generator.

#6 @dd32
14 years ago

  • Component changed from Editor to TinyMCE
  • Keywords needs-patch added
  • Milestone changed from 3.0 to Future Release

If there is indeed a bug here, a patch is needed to keep it here, I'm moving to Future Release pending a patch.

#7 @azaozz
10 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

This was fixed quite some time ago: inserting content while the caret is inside a caption now produces new <p> under it and places the content there.

#8 @nacin
10 years ago

  • Resolution changed from fixed to worksforme

#9 @nacin
10 years ago

  • Milestone Future Release deleted
Note: See TracTickets for help on using tickets.