The solution here is to remove any/all html comments
<!-- ... -->
and javascript comments
// comment
from the html, and to use the NoFileHtml extension.
For some reason, the text block does not handle these well causing the webviewer to try to parse them as either html or javascript.