Thanks for all the useful guidelines above. In the meanwhile I've indeed found the solution. There is a setting for the TinyMCE plugin called "Urls". No further explanation, but default is "relative". I set this to "absolute" and this basically eliminated the problem.
I think you answered your own question, there, so I'll just chime in with some extra detail.
First, I only rarely use any of the js wysiwyg editors for precisely this sort of reason; the take away your control over the data, and substitute the judgement of someone who has no idea what you need it to do.
The data attribute you mention isn't the cause; it ...