Skip to content

Allow set content of selection from AstNode #552

@mvn-hoangduong-hn

Description

@mvn-hoangduong-hn

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!
            });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions