ZSSRichTextEditor icon indicating copy to clipboard operation
ZSSRichTextEditor copied to clipboard

insertHTML(html) does not work

Open PanagiotisVakalis opened this issue 8 years ago • 1 comments

I am using this function in order to add a span inside a HTML. However it seems that it is not working. I have used your example and still nothing is being added. The weird thing is that when I am trying the second time in the application, the HTML is being inserted. I used the setHTML function in order to check whether my HTML can be rendered and the HTML is being set successfully. I am using Swift 3, how can I insert a block of HTML?

Thanks in advance.

PanagiotisVakalis avatar Jul 25 '17 13:07 PanagiotisVakalis

you can check this return value var result = document.execCommand('insertHTML', false, html); if the result is false, then you should find that whether the selection(by document.getSelection(); ) is in the right state.

WildStrom avatar May 17 '18 08:05 WildStrom