When I use the "Add media" button in the TinyMCE WYSIWYG toolbar to upload and embed an image, then use the "Insert/Edit Link" button to link the media, the link is lost when the data is saved.

Additionally, if you toggle the "Disable rich-text" you can see that the links are lost even before saving. It's as if TinyMCE isn't considering the media macro ([[{"fid":"81","view_mode":...) as something that can be linked.

But if I disable rich-text and manually add the anchor tags around the macro they work properly and are persistent.

Comments

anthonylindsay’s picture

That can also happen in the 7.x-1.x version if you don't have whitespace (spaces or new lines) around your image, I have found.

My guess is that Media's html is a bit broken and the editor is trying to cope by stripping out what is sees as malformed html.

anthonylindsay’s picture

I should also mention that in my case it was with CKeditor, rather than TinyMCE.

I solved it by turning off the 'source formatting' filter so that the editor did not try to clean up the HTML.

Chris Matthews’s picture

Version: 7.x-2.0-alpha3 » 7.x-2.x-dev
Status: Active » Closed (outdated)
Issue tags: -wysiwyg, -links

Closing this issue as outdated. However, if you think this issue is still important, please let us know and we will gladly re-open it for review.
sincerely,
- the Drupal Media Team