We want to provide a dedicated CE-field formatter that nicely processes a ckeditor/filtered-richt text into a proper tree of custom elements.
In particular, we need to support the use case of Drupal media or Entity embeds nicely. That means the referenced media/entity reference needs to be rendered via the CE-entity-processing into a custom element object.
Thus we want a resulting custom element tree like this:
<div>
<drupal-markup> .. all the markup before first embed </drupal-markup>
<drupal-media image-src="..." > .... nested props and slots as configured for it </drupal-media>
<drupal-markup> some more markup </a>
</div>
Next, we next the special challenge of handling wrapping html elements properly, since drupal-media can be contained in tables or other elements.
With wrapping markup the returned tree could look like this
<div>
<drupal-markup> .. all the markup before first embed </drupal-markup>
<drupal-ce-markup prefix="<a href>" suffix="</a>">
<drupal-media ... - render it and produce drupal-media custom-element </drupal-media>
<drupal-media ... - render it and produce drupal-media custom-element </drupal-media>
</drupal-ce-markup>
<drupal-markup>
<drupal-ce-markup prefix="<a href>" suffix="</a>">
<drupal-media ... - render it and produce drupal-media custom-element </drupal-media>
</drupal-ce-markup>
<drupal-markup>
</div>
Needs work
3.0
Code