do not call result_updated unless you have a result, and HTML-escape content when it is added by us instead of knitr. Fixes #786
Merge branch 'bugfix-786' into develop