Skip to content

Markdown Features

Mikhail Deynekin edited this page Nov 14, 2026 · 2 revisions

Markdown features

CommonMark core

Headings, emphasis, links (inline, reference, autolinks), images, blockquotes, ordered and unordered lists, fenced and indented code, thematic breaks, HTML blocks and inline HTML, hard/soft breaks, backslash escapes, entity references.

GitHub Flavored Markdown

Tables (alignment honoured), task lists, strikethrough, autolinks for bare URLs, fenced code with an info string, and footnotes.

MD.Scribe extensions

Feature Syntax Notes
Alerts > [!NOTE], [!TIP], [!IMPORTANT], [!WARNING], [!CAUTION] GitHub-compatible, themed per kind
Math $inline$, $$block$$ KaTeX, rendered locally — no CDN
Diagrams ```mermaid local Mermaid bundle, CSP-safe
Wikilinks [[Page]], [[Page|label]], [[Page#Heading]] resolved next to the source, then at the browse root
Backlinks — "Linked from" panel, index in storage/index/
Tags frontmatter tags: [a, b] tag pages and tag: search operator
Glossary tooltips a two-column table (Term / Definition) hover/tap definitions, alias expansion for Term (ABBR)
Definition lists Term then indented : definition
Attributes ## Heading {#custom-id .extra-class} custom ids survive the sanitiser
Highlight ==marked==
Sub/superscript H~2~O, E=mc^2^
Emoji :smile: local map, no network
Smart punctuation quotes, dashes, ellipses toggleable

Each extension has its own FEATURE_* key in .md.ini (see Configuration), so a strict CommonMark deployment is one config change away.

Diagrams (Mermaid 12.3.0)

A ```mermaid fence is rendered locally by the vendored Mermaid build — no CDN, no network, CSP-safe (style-src 'unsafe-inline' is the documented trade-off, because the generated SVG carries inline styles).

The bundle is Mermaid 12.3.0 (5.5 MB raw, 1.6 MB gzip, injected only on pages that contain a diagram). What 12 adds for a document author:

Feature Syntax
Edge IDs (for styling, classes and animation) A e1@--> B
Animated edge e1@{ animate: true } or e1@{ animation: fast }
Step-by-step flow animation (12.3+) e1@{ step: 1 }, tuned by flowchart.stepDuration / flowchart.stepNumbers
Circle and cross edge markers A ---o B, A ---x B
Extended shapes A@{ shape: manual-file, label: "File" }, cyl, doc, paper-tape, stored-data, …

The look is pinned to 11.x on purpose. Mermaid 12 draws flowcharts with the redux-color theme, the neo look and an ELK layout by default, which would restyle every existing diagram without anyone asking; the loader sets look: classic and layout: dagre. Measured on the same document against 11.17.2: a sequence diagram keeps its geometry exactly (-50 -10 514 451 on both), a flowchart is laid out with 12's wider spacing (0 0 624.66 140 → 0 0 837.88 140, same height, still scaled to the column).

Server-side auto-repair reaches the page. The repair engine quotes node labels with unquoted parentheses, converts PlantUML note … end note blocks and return, replaces literal \n, closes <br>; the repaired source is what Mermaid parses, while the author's original stays behind the Copy source control. Repairs are listed under the diagram, and a diagram that still fails keeps its source visible and copyable.

Code blocks

Highlighted server-side with a local highlighter; the info string selects the language. Long blocks get a copy button and an optional download link (FEATURE_COPY_BUTTON, FEATURE_DOWNLOAD_BUTTON).

Links and media

  • Relative links resolve against the current document; .. above the browse root is refused.
  • Downloads: ?file=…&download=1 serves the source with text/markdown.
  • Remote images load only while ALLOW_EXTERNAL_IMAGES is true; nothing else is fetched remotely.
  • Raw HTML is always passed through a DOM allowlist — <script>, on* handlers and javascript: URLs are removed, never rendered.

Table of contents

AUTO_TOC builds the in-document TOC, AUTO_NUMBERING numbers headings, and anchors are generated from the heading text including non-Latin scripts — ## Что сначала попробовал becomes #что-сначала-попробовал and survives sanitising (fixed in 3.3.0; before that, ids starting with a non-ASCII letter were dropped).

Clone this wiki locally