Generating HTML preview from user input

I’m trying to generate a preview of user input with all of the html markup added. I’m able to the users input into an HTMLElement, but cannot display it.

Here’s the snippet https://webix.com/snippet/88aa1026

Template function has to return a string, which will be converted to an HTMLElement. Please check: https://webix.com/snippet/e16780df