EditorStateOptions
What a new editor state starts with (createEditorState). Every field is optional.
Properties
Section titled “Properties”checkSpelling?
Section titled “checkSpelling?”
optionalcheckSpelling?:boolean
Draw spelling squiggles when the environment's spell service is on. Turn it off for an editor where a squiggle could not be fixed. Default true.
diagrams?
Section titled “diagrams?”
optionaldiagrams?:boolean
Render ```mermaid fences as diagrams. With false, they show as
ordinary code blocks and Mermaid is never loaded — for a page that must not
download it, or whose Content Security Policy cannot allow Mermaid's inline
styles (see the self-hosting guide). Default true. Ignored by the
@openmarkdown-dev/editor/no-diagrams entry, which never renders diagrams
and does not contain Mermaid at all.
optionaldoc?:string
The Markdown source to edit. Default: the empty document.
docPath?
Section titled “docPath?”
optionaldocPath?:string|null
The document's absolute path, or null for an unsaved one. Relative links and images resolve against it, and pasted images are stored beside it. Default: null.
extensions?
Section titled “extensions?”
optionalextensions?:Extension
Your own CodeMirror extensions, installed in this state beside the editor's. They stay installed in every mode and travel with the state.
optionalhost?:EditorHost
The per-document callbacks (change, links, images, attachments, completion, outline). Default: none.
optionalmode?:EditorMode
Live preview (default), plain source, or read-only reading mode.
selection?
Section titled “selection?”
optionalselection?:object
Where the caret starts (UTF-16 offsets into doc). Default: the start of the document.
anchor
Section titled “anchor”anchor:
number
optionalhead?:number