Skip to content

Markdown

MDLeaf follows CommonMark and adds the GitHub extensions most people use.

FeatureSyntax
Headings# Title … ###### Small (or underlined with === / ---)
Emphasis*italic*, **bold**, ~~strikethrough~~
Inline code`code`
Links[text](https://example.com), [text](#a-heading)
Images![alt](assets/figure.png) — see image attributes
Lists- item, 1. item, task lists - [ ] todo / - [x] done
Quotes> quoted text
Code blocksfenced with three backticks, optionally with a language
TablesGitHub pipe tables
Horizontal rule--- on its own line, after a blank line
Autolinksbare https://… and www.… addresses become links

Every heading gets an id made from its text: lower case, spaces become -, punctuation is dropped, and repeated headings get -1, -2, … So ## Results and Discussion can be linked with [see results](#results-and-discussion). Use Insert → Link to heading… (macOS: ⇧⌘K, Windows and Linux: Ctrl+Shift+K) to pick a heading from a list.

Code blocks are shown in a monospace font on a shaded background. Name the language after the opening fence (```js, ```python, ```sh, ```diff …) and the code is coloured in the editor, the preview and the PDF, using the same grammars everywhere. A fence with no language, or one MDLeaf does not know, stays plain. Long lines wrap so that nothing is cut off in the PDF.

Themes choose the colours with the --mdl-code-* properties of the CSS contract, for example --mdl-code-keyword and --mdl-code-string.

You may write HTML, but it is cleaned for safety before it reaches the preview: <script>, <style>, <iframe>, <object>, <embed>, <form> and <link> are removed, as are event handlers and javascript: links. The editor warns about removed tags. Inline <svg> is removed too; reference SVG files as images instead.

Task-list checkboxes are read-only in the preview — tick them in the source.