Problem/Motivation
We added support for markup in data-caption
in #3222808: Follow-up for #3201646: markup in image captions is lost. However, we only ever tested data-caption
with data that upcasts into $text
. However, there are examples of valid child elements of <figcaption>
that would upcast into a model element (e.g. <section>
would be a valid child of <figcaption
).
Steps to reproduce
- Create new text format that has Drupal Media + Image captions enabled and add
<section>
to source editable elements - Create content using the new text format
- Embed media to the content and enable captions
- Add
<section>
to thedata-caption
value in source editing - Return back to editing 💥