This problem is not unique to Silverstripe. I have looked back at other sites that I have used similar coding on and I remembered one I did on another cms platform. The way I got round it that time was to turn off the wysiwyg editor, edit page in html, save and publish page then turn editor back on. It was a simple process on that cms because you could turn the wysiwyg editor on and off in the admin panel.
There will be a way to do it on silverstripe we just have to keep plugging away.
PS if anyone finds solution please share on here.