You need to allow data-attributes by adding your own TinyMCE configuration options. These links should get you there:
Am using the HTML editor within edit mode to do some tweaking on one of my pages - however it strips things out.
All I'm trying to do is add data-lightbox="image-1" within the HTML editor, but it removes it when I press save.
Is there no way we can assign the page not to be so strict in its conversion to epiServer code?