You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enables paste and drag-and-drop of images. An "Uploading…" placeholder is inserted at the caret and replaced by  when your function resolves; edits made in the meantime are preserved. Without this prop, image files are ignored and nothing is embedded or sent.
onImageUploadError
(error: unknown, file: File) => void
Called if the upload rejects. The placeholder is removed automatically.
A complete standalone page: doctype, embedded stylesheet (follows light/dark), working tabs and copy buttons. Options: title, lang, css, plus the render options.
enhanceHtml(root?)
Adds code-tab and copy-button behaviour to HTML rendered with scripts: false. Returns a function that removes the listener.
sanitizeUrl(url)
The exact URL filter the renderers use. Returns the URL or "#".
inlineToPlainText(nodes)
Plain text of inline nodes (handy for building a table of contents).
Render options
Option
Type
Default
Description
highlighter
Highlighter
built-in
openExternalLinksInNewTab
boolean
true
scripts
boolean
true
Emit the inline <script> blocks for tabs and copy buttons. Set false for strict CSP and call enhanceHtml().
headingIdPrefix
string
""
Prefix for heading ids and anchors. If you read node.id yourself (for a table of contents), add the prefix.
headingOffset
number (0 to 5)
0
Editing commands (react-markdown-studio/editor)
Every toolbar action is a pure function (state: { value; selection }) => state, so you can build your own UI. Examples: toggleBold, toggleItalic, setHeadingLevel, toggleOrderedList, insertLink, insertTable, indentLines, outdentLines, continueList, replaceText, linkSelection. Also exported: HistoryStack (undo/redo), matchShortcut and SHORTCUTS, getTextStats and getCaretPosition, and SYNTAX_REFERENCE (the data behind the in-editor help and the website).
Highlighter (react-markdown-studio/highlighter)
highlight (the default), supportedLanguages(), isLanguageSupported(lang), and the token colour maps githubLightTokenColors / githubDarkTokenColors. A custom highlighter is a function (code: string, lang: string | undefined) => Token[].
CSS variables
All colours live on the editor root and are prefixed --rmds-: --rmds-bg, --rmds-bg-subtle, --rmds-bg-inset, --rmds-border, --rmds-border-subtle, --rmds-text, --rmds-text-muted, --rmds-accent, --rmds-code-bg, the --rmds-alert-* colours and --rmds-tok-* syntax colours. Override them in a rule that targets your className.