foundryvtt
foundryvtt copied to clipboard
Images embedded in the ProseMirror editor lose their align attributes when saved
Originally reported by H2Os#8859 https://discord.com/channels/170995199584108546/956306859491471420/1017126808690372660
ALL MODULES DISABLED? true
OS, Hosting, Browser (if applicable): Windows 11, Forge Hosting, Google Chrome
Short Description of bug: Attempting to Align and wrap text around an image. The preview shows the wrap happening, but the result doesn't show on the page. While the preview shows the correct layout. It doesn't actually save. If I close the edit box and open it again the added "align" code is gone.
Simple steps to reproduce the bug: attempt to wrap text around an image. I used the code <img align="right" src="https://assets.forge-vtt.com/5f6a374ada33a5f2f30261d9/pdftofoundry/quest-for-the-frozen-flame2/roru.actor.webp" width="250" height="500" style="">
Screenshots and/or console errors:
align
is a deprecated <img>
attribute, but it should still be preserved by our general attribute preservation mechanism so worth investigating.
This is being stripped by our HTML sanitisation. I don't think we typically include deprecated attributes in our allow-list so closing this as wontfix. Our editor has a built-in alignment function that works on images and uses float
so this should not be a blocker for anything.