Yes, if you went fully in that direction you’d have to trade off not being able to edit content in Discourse with complete HTML integrity.
I was thinking there may be some middle ground where you just apply this approach to img
tags in imported HTML posts.
But I’m second-guessing myself now. Doing this selectively would require changes in many parts of post processing.