There’s no template or configuration for that - that’s meant for Redactor internally to track the source file (that could theoretically be an asset ID of sorts).
I’ve made a note to look into this to see if there’s a way to disable that or to filter it out on save to leave the cleanest possible markup.
Just to provide some feedback, redactor.js does currently offer an option to disable the data-image on images, but not the data-file or data-name attributes on file links.
I’ll keep the internal feature request open to look at a custom cleanup function of sorts that strips it on save.
Thanks for the feedback
I have asked because I get issues on a website because of this data attribute : I have to remove them manually to solved it.
So on option to removed them globally could be useful
It would be possible to clean it up server side with a snippet that parses the content (regex or domdocument based perhaps) but I don’t readily have an example of that. This code on StackOverflow may serve as an example, except you’re looking for attributes data-file, data-image rather than style: https://stackoverflow.com/a/3026411/1277345
Out of curiosity though, what sort of issues is this causing in your front-end? Is it being interpreted by some javascript library or something like that?
The problem is when my customer upload a file with special character (space or accent) within Redactor, the data-file attribute doesn’t parse it correctly and don’t close the double quote of the data-file atrribute.
Example :