[wp-trac] [WordPress Trac] #28272: Image looses link after drag and drop

WordPress Trac noreply at wordpress.org
Sat May 17 12:09:33 UTC 2014


#28272: Image looses link after drag and drop
--------------------------+------------------------------
 Reporter:  avryl         |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  TinyMCE       |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by afercia):

 Replying to [ticket:28272 avryl]:
 some additional details:
 > The link is gone.
 it depends, if your linked image is inside a paragraph which contains text
 before and after the linked image, after you drag the image in a new
 position, the link will still be there in its original position and it
 will be "empty". TinyMCE won't clean up this empty link because it
 actually contains a line break, so your content will be saved and it will
 contain empty links, which is bad :)

 To be more clear, this:

 {{{
 <a href="http://www.somelink.com"></a>
 }}}
 gets removed by TinyMCE when it runs its "cleanup" but this:

 {{{
 <a href="http://www.somelink.com">
 </a>
 }}}
 doesn't.


 About dragging, when you click a linked image, TinyMce shows you the
 current selection in the statusbar "path" as:
 p » a » img
 so you're actually selecting the image element and when you drag, you drag
 the img element.
 The only way I'm aware of to drag the linked image together with its link,
 is to actually select the a element so just click the "a" in the TinyMCE
 statusbar path, and it will change to:
 p » a
 drag now to another paragraph and linked image will be moved correctly.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/28272#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list