Opened 5 months ago

Last modified 3 months ago

#23103 new defect (bug)

Non image caption shortcode lost when switching from text to visual editor and back

Reported by: mark-k Owned by:
Priority: normal Milestone: Awaiting Review
Component: Editor Version: 3.4
Severity: normal Keywords:
Cc:

Description

  1. Add the line in text editor
    [caption caption="test" width="300"]Checkuot this text[/caption]
    
  1. switch to visual editor
  1. switch back to text and you get
    <dl class="wp-caption alignnone" id="" style="width: 310px;"><dt class="wp-caption-dt">Checkuot this text</dt><dd class="wp-caption-dd">test</dd></dl>
    

Change History (2)

  • Version changed from 3.5 to 3.4

Reproduced in 3.4 as well. In 3.3 and earlier, only "Checkout this text" remains.

Seems related, though I haven't checked pre-3.5. If you have a normal captioned image, but remove the width attribute, for example:

[caption id="attachment_67" align="alignnone" width="300"]
<img class="size-medium wp-image-67" alt="caption" src="http://local.dev/stable/wp-content/uploads/2012/11/cropped-tree-300x149.png" height="149" /> caption[/caption]

Then switching to visual and back strips away the shortcode entirely leaving you with:

<img class="size-medium wp-image-67" alt="caption" src="http://local.dev/stable/wp-content/uploads/2012/11/cropped-tree-300x149.png" height="149" />
Note: See TracTickets for help on using tickets.