Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow set content of selection from AstNode #552

Open
mvn-hoangduong-hn opened this issue Oct 3, 2024 · 0 comments
Open

Allow set content of selection from AstNode #552

mvn-hoangduong-hn opened this issue Oct 3, 2024 · 0 comments

Comments

@mvn-hoangduong-hn
Copy link

mvn-hoangduong-hn commented Oct 3, 2024

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!
            });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant