Skip to content

Getting Content From Editor #45

Answered by umaranis
raknay asked this question in Q&A
May 21, 2023 · 1 comments · 4 replies
Discussion options

You must be logged in to vote

Hi @raknay ,

If you are using RichTextComposer, you need to get a reference to it using bind:this={composer}, then call composer.getEditor().getEditorState().
This is going to return the state in JSON format.

Here is a similar example that prints editor contents to the console log every time the content changes.
https://github.com/umaranis/svelte-lexical/blob/f2b1f63cac29bb16e93186fe128fae2528eab723/demos/playground/src/App.svelte

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@enesbala5
Comment options

@umaranis
Comment options

@milansimek
Comment options

@umaranis
Comment options

Answer selected by umaranis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants