Problem/Motivation
Core currently provides support for embedding of images. It is currently impossible to embed a video or a document. Also, when #2801277: [META] Support remote media assets as first-class citizens by adding Media Entity module in core lands we'll need to embed media entities rather than files.
Contrib already has a solution for this. Entity embed is a module that supports embedding of any renderable entity and supports extensive display configuration.
Proposed resolution
Move parts of Entity embed into core (simplified text filter) and handle embedding through it. Entity embed display plugins, embed button config entities, and other related API surface will stay in contrib. The simplified text filter will only support embedding media entities; people wishing to embed other types of entities will need to use contrib. Existing WYSIWYG functionality would remain the same.
Remaining tasks
In order:
- ✅
#2940029: Add an input filter to display embedded Media entities - ✅
#2994696: Render embedded media items in CKEditor - ✅
#2994699: Create a CKEditor plugin to select and embed a media item from the Media Library - ✅
#2994702: Allow editors to alter embed-specific metadata, as well as `data-align` and `data-caption` - ✅
#3066802: Ensure that embedded image media items do not display at unreasonable sizes by default - SHOULD-HAVE: Either #3074608: Optionally allow choosing a view mode for embedded media in EditorMediaDialog or #3078287: Constrain the width of aligned images, media, blockquotes etc to a max of 75%. Both would be great, but either one is sufficient to make media embedding usable enough to allow Media Library to be stable.
- SHOULD-HAVE #3073901: Determine an upgrade path from CKEditor image button to media library
- #3081303: Allow media embed width constraint to be configurable
Additional required bug fixes:
#3081983: Double Alignment classes on widget wrapper for embedded media in CKEditor- #3081988: Disappearing edit button and caption on media embed when using dialog
- #3067116: text_summary() returns malformed (not normalized) HTML for basic_html and other formats that use filter_html instead of filter_htmlcorrector
- #3067124: text_summary() returns a plain string, even if passed a MarkupInterface object
Additional related and follow-up issues
- #3074859: Add a button to remove an embedded media item from the editor
- #3074863: Improve the UX of captioning in CKEditor
- #3074867: Remove role attribute from figure tags generated by filter_caption
- #2910102: Improve icon colour contrast for WCAG 2.1
- #3071713: Make error messages for embedded media themeable
- #3068786: Allow customization of missing media indicator returned by MediaEmbed filter
- #3069525: Refactor to remove drupalunlink event listeners for registered linked widgets
User interface changes
TBD
API changes
TBD
Data model changes
TBD