Your comments

Maybe turn it on globally or only for specific file extension?  Or even smarter:  Turn off / on globally and then make it possible to exempt certain file settings as per file type?  Globally on, but markdown is exempt:  Markdown will not be tripped.  Globally off, but C code ix exempt: C will be stripped.  But maybe that is just to much magic :)

Imo, turning it on or off would be enough.  And I think it should be off by default, as this is the current behaviour.

I fully agree.  Not having this option is currently a downside of this editor.

Actually I would like this to be an option, trim trailing whitespace on save.  The example you give about why not to do it seems a bit sought after to me.  There will be more cases probably where this feature would be useful.  And as it is an option, everyone is free to use it or not.