Using Media and IMCE File Manager together on a Drupal 9 site

Insert an image with a link using IMCE File Manager (AKA, the file browser we used with Drupal 7)

For sites that expect to create links on images on a regular basis, an alternate file browser can be added for your site, providing an additional button to Insert from IMCE File Manager. This button inserts an image as a plain <img> tag that won't trigger the empty paragraph bug when a link is added to the image. This configuration is supported as a workaround and will be phased out when the bug is fixed.

Bug: Media images with links create empty paragraph tags

An unfortunate bug exists in Drupal 9 related to adding links around images inserted from the Media Library into a field with the editing toolbar: each time the editing toolbar loads, an empty paragraph tag is added after any Media image with a link. If the page is saved without deleting the empty paragraph, it will add a visible blank line in the content. Repeated edits will insert more empty paragraphs that will build up. The following actions are known to trigger this bug:

Subscribe to RSS - media