foundryvtt icon indicating copy to clipboard operation
foundryvtt copied to clipboard

Images embedded in the ProseMirror editor lose their align attributes when saved

Open Fyorl opened this issue 2 years ago • 1 comments

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:

image

Fyorl avatar Sep 08 '22 11:09 Fyorl

align is a deprecated <img> attribute, but it should still be preserved by our general attribute preservation mechanism so worth investigating.

Fyorl avatar Sep 08 '22 11:09 Fyorl

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.

Fyorl avatar Oct 13 '22 17:10 Fyorl