tinymce-react icon indicating copy to clipboard operation
tinymce-react copied to clipboard

Allow set content of selection from AstNode

Open mvn-hoangduong-hn opened this issue 1 year ago • 0 comments

I can get content of selection as AstNodes, but I cant find any option to set content of selection back from AstNodes, or any helper to convert AstNodes to html if i'm using cloud deployment

I would suggest to add a helper to convert AstNodes to html, or/and a method to set content of selection from AstNodes

If i import tinymce, editor switch to self-deploy mode, and i do not want that. But the method to convert AstNodes to html is only available inside tinymce

Thanks!

            editor.on("change", () => {
              const content = editor.selection.getContent({
                format: "tree",
              });
              content.value += "test";
              editor.selection.setContent(content); // Error!
            });

mvn-hoangduong-hn avatar Oct 03 '24 03:10 mvn-hoangduong-hn