xing/wysihtml5 — pull request #159 by jslaybaugh (2012-07-21 00:47:42+00:00)
Title: IE8 'unknown runtime error' when setting 'invalid' html

Ran into a weird error in IE8 where it doesnt throws "unknown runtime error" when you try to set the innerHTML and pass it *what it thinks* is invalid HTML. I stumbled across some information when searching if this was a known error: https://www.google.com/search?sugexp=chrome,mod=0&sourceid=chrome&ie=UTF-8&q=unknown+runtime+error+wysihtml5+ie8&qscrl=1

In the end, what I was using seemed to be perfectly valid HTML (all tags were closed and nested properly) but I think maybe it didnt like the wysiwyg-* classes. Anyway, I started playing around and this solution actually worked for me in IE8 and still works great in all other normal browsers. I catch the exception and then set the innerText to the html value. The iframe kinda flashes for a second, but then it all gets parsed correctly and displayed correctly as well.

So, for what its worth (not thoroughly tested) I hope this is helpful.

Thanks for the awesome library!

Jorin