API reference
@salmonui/editors/markdown-editor
27 exported symbols: 5 functions, 11 interfaces, 6 types and 5 constants. Each name links its page with the signature, docs and members.
import { … } from '@salmonui/editors/markdown-editor';Functions
MarkdownEditorapplyMarkdownCommandRuns a text command; returns the new state.continueMarkdownListEnter inside a list item: continues the marker on a new line (the next number for ordered lists, an unchecked box for task lists); on an empty item it removes…shortcutCommandThe command of a Mod shortcut, or null. Undo / redo stay native.tableMarkdownA GFM table of rows body rows and cols columns, with header cells header(i).
Interfaces
MarkdownBeforeCommandEventMarkdownCommandEventMarkdownEditorApiRef handle.MarkdownEditorLocaleTextText of the toolbar, dialogs and count. {0} is the heading level or column number.MarkdownEditorPropsMarkdownSyntaxMarkers per command: merged over the CommonMark / GFM defaults by the syntax prop.MarkdownTextStateMarkdownToggleEventSecond argument of onPreviewChange / onFullscreenChange (frozen).MarkdownToolbarCustomItemA custom toolbar item.MarkdownUploadResultUpload hook result.MarkdownValueChangeEventSecond argument of onValueChange (frozen).
Types
MarkdownEditorPartMarkdownEditorSourceInput that ran a command.MarkdownPreviewModePreview state: hidden, instead of the source (tab), or beside it (split).MarkdownTextCommandText commands applyCommand runs (the toolbar adds dialogs, history, preview and fullscreen).MarkdownToolbarItemA toolbar entry: a built-in id, '|' for a separator, or a custom item.MarkdownToolbarItemIdBuilt-in toolbar item ids.
Constants
DEFAULT_MARKDOWN_SYNTAXMARKDOWN_DEFAULT_LOCALE_TEXTMARKDOWN_DEFAULT_TOOLBARThe default toolbar.imageMarkdown!alt.linkMarkdowntext; an empty text uses the URL.