How to set initial value that's just a plain string? #16
Unanswered
tihomir-kit
asked this question in
Q&A
Replies: 1 comment
-
There is a great discussion forum at discuss.prosemirror.net for questions about Prosemirror. This library is just an extremely thin shim of convenience for React apps. As for how it is used in this hook, you need to create a config object that basically matches the interface to ProseMirror's EditorState.create() method. Getting from a simple piece of text to a value that conforms the config.doc property is a few steps and depends largely on how your document is persisted and what the valid schema is for your document. Assuming a very basic document schema such as what is found in the Prosemirror basic example, the steps would be:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, thank you for your package.
'm a bit confused though about how to initialize ProseMirror with the initial value? Say I loaded something from a webapi, and want to set it as the initial value, and that something is
var value = "*some sentence* whatever."
. How would I initialize ProseMirror with that value?Or is there a fundamental misunderstanding how this is supposed to work on my end?
Thanks a lot.
Beta Was this translation helpful? Give feedback.
All reactions