You might have solved this by now. Your HTML code is clearly beyond what the built-in WYSIWYG editor can handle. One way: switch to the raw HTML editing mode (button <>). In that mode, it should save HTML as entered by you. Another way: turn WYSIWYG editor off altogether (in your user settings) before editing this resource.