Media embeds in text fields do not work properly

Created on 26 December 2023, 6 months ago
Updated 11 January 2024, 6 months ago

Problem/Motivation

After embedding media in a text area that uses CKEditor5, the markup in the text area is faulty.

Steps to reproduce

  1. Enable the Drupal Media and Source plugin in a CKEditor5 text format. The Source plugin is for debugging.
  2. Create a custom field with a Text (long) field item. Configure it to have an enabled wysiwyg, and select the text format that has the Drupal Media plugin enabled.
  3. Embed media using the Drupal Media plugin.

Expected:
Click the Source button: see only an <drupal-media> tag.

Actual:
Click the Source button: see rendered media markup wrapping a <drupal-media> tag.

Also, after saving, the media embed gets fully converted to the rendered version. So when editing again, there is no <drupal-media> at all.

Proposed resolution

TBD

Remaining tasks

TBD

User interface changes

None expected

API changes

None expected

Data model changes

None expected

πŸ› Bug report
Status

Fixed

Version

2.0

Component

User interface

Created by

πŸ‡ΊπŸ‡ΈUnited States nadavoid

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024