Skip to main content

Markdown Syntax Overview

ToastWrite is built on CommonMark with GitHub Flavored Markdown (GFM) extensions. The @toastwrite/parser package parses your Markdown incrementally, and the editor provides syntax highlighting, toolbar commands, and live preview for the same syntax.

Supported features

FeatureSpecToolbar
HeadingsATX and SetextHeading dropdown
Text formattingCommonMark + GFMBold, italic, strike, code
LinksCommonMark + GFM autolinksLink
ListsCommonMark + GFM tasksBullet, ordered, task
BlockquotesCommonMarkBlockquote
AlertsGFM alertsBlockquote
TablesGFMTable
CodeCommonMark fencedCode, code block
ImagesCommonMark
Horizontal rulesCommonMarkHR
Front matterYAML, TOML, JSON— (opt-in)
Reference definitionsCommonMark— (opt-in)

Toolbar keyboard shortcuts

Shortcuts use Mod as Cmd on macOS and Ctrl on Windows/Linux.

CommandShortcut
BoldMod-b
ItalicMod-i
StrikethroughMod-Shift-s
Inline codeMod-e
Code blockMod-Shift-c
LinkMod-Shift-k
BlockquoteMod-Shift-q
Ordered listMod-Shift-7
Bullet listMod-Shift-8
TableMod-Alt-t
Heading 1–6Mod-Alt-1Mod-Alt-6

Optional parser features

Some syntax requires enabling options on the editor or viewer:

new Editor({
el: root,
frontMatter: true, // YAML/TOML/JSON front matter
referenceDefinition: true, // Reference-style links and images
});

Live preview

The editor renders preview HTML through @toastwrite/parser's renderer with DOMPurify sanitization. You can hook into rendering with beforePreviewRender:

new Editor({
el: root,
beforePreviewRender: (html) => html.replace(/<a /g, '<a target="_blank" '),
});

Browse the sections in this category for syntax examples and usage notes for each feature.