Problem/Motivation
Inline images have a different set of allowed attributes compared to block images. It seems like there are some cases where an image could accidentally convert into an inline image on upcast, leading into attributes being removed.
Steps to reproduce
- Ensure that
<div>
is not allowed, but images are allowed, including captioning and aligning. - Create following markup:
<div><img data-caption data-align></div>
- This will be converted into
<p><img data-caption data-align></p>
(which consecutively converts to
) - Downcast the model again and see that
data-caption
anddata-align
disappear 💥