Can the HTML data you load already have angle brackets hidden in HTML objects? That is, <becomes <while> becomes & gt;
This will lead to the behavior you described. The visual editor will show what it looks like raw HTML, not the result of rendering HTML.
To fix it, either (i) prevent this encoding, or (ii) a quick and dirty approach, search and replace in HTML before passing your API. Sort of:
html = html.replace('<', '<') html = html.replace('>', '>')
gotta do the trick.
source share