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

Load different content #5710

Open
tingjiangcao opened this issue Sep 1, 2024 · 1 comment
Open

Load different content #5710

tingjiangcao opened this issue Sep 1, 2024 · 1 comment
Labels

Comments

@tingjiangcao
Copy link

I'm developing a note-taking software. Need to switch between different note files. And the method I have found so far is as follows:

Transforms.delete(editor, {
at: {
anchor: Editor.start(editor, []),
focus: Editor.end(editor, []),
},
})
Transforms.removeNodes(editor, {at: [0],})
Transforms.insertNodes(editor, noteObject)
Transforms.select(editor, Editor.start(editor, []));

I'm wondering if there is a more simplified way that can be provided to accomplish this group. Because this is a more commonly used function.

I'm not sure if there's a method I'm not aware of

@yf-yang
Copy link
Contributor

yf-yang commented Sep 2, 2024

https://github.com/udecode/plate/blob/main/packages/slate-utils/src/transforms/replaceNode.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants