Linedown: the markdown dialect FUTO Notes reads
Linedown is the markdown dialect the FUTO Notes editor reads on every platform, starting with FUTO Notes 2.0. Linedown uses the characters of CommonMark and GitHub Flavored Markdown (GFM), but reads them one line at a time: every line break in the file is a line break on screen, and nothing you type can restyle the line above it.
Most people never need this page. The editor’s toolbar, and the / menu on desktop, write the syntax for you, and Markdown in FUTO Notes covers everyday formatting. This page is the reference for people who already know markdown and want to know why FUTO Notes shows a file the way it does, or why another app shows the same file differently.
Linedown describes how text is read. What the editor does while you type, such as continuing a bullet when you press Enter, is in Markdown in FUTO Notes.
How Linedown reads a note
Linedown reads a note one line at a time, and every line is exactly one block: a heading, a bullet, a plain line, and so on. Three rules follow from that.
A later line never changes an earlier one
A line’s meaning never changes because of a line after it, so what you type can never restyle what is above your cursor. In CommonMark, this note has a heading in it:
grocery list-In CommonMark, the - on the second line turns “grocery list” into a heading. In Linedown, “grocery list” is a plain line, and it stays one whatever you type below it. The - is a plain line too. Once you add a space after it, the second line is an empty bullet.
Linedown has two exceptions to this rule, a table’s header and front matter’s closing line. Both are listed in When one line affects another.
Every line break is a line break
Linedown has no paragraphs: each line in the file is a line on screen. This note is two lines, and it shows as two lines:
foobarA blank line is an empty line, and three blank lines show as three empty lines. You don’t need a trailing backslash or two trailing spaces to break a line.
A line ends at \n or \r\n. A lone \r is an ordinary character.
Linedown is not tied to HTML
Linedown defines what each line is, not the HTML it turns into. CommonMark defines markdown by the HTML it produces. Linedown says what a line is: a heading, a bullet at some indent, a run of bold text. HTML is one way to draw that, and a phone’s native text view is another. No Linedown rule exists because of how HTML would render it.
When one line affects another
A line in Linedown is read by its own text, with six exceptions. No others exist.
An earlier line affects later lines in four cases:
- Code fence. After an opening fence, every line is code until the closing fence. With no closing fence, code runs to the end of the note.
- Front matter. If line 1 is
---and a later line is---, every line between them is front matter. - Table rows. A line starting with
|is a table row only when it follows a table’s header and delimiter row. - List levels. The indents of the list items above a line decide how deep that line is drawn. They never change what kind of block the line is, or anything in the file. See Lists.
A later line affects an earlier line in two cases:
- Table header. A delimiter row, such as
|---|---|, turns the single line directly above it into a table header. - Front matter close. A
---line closes front matter that line 1 opened. Until that closing line exists, line 1 is a divider and every line is read as usual.
These two are the only cases in Linedown where a line changes the meaning of a line before it.
Blocks
Every line in a Linedown note is exactly one of these blocks.
| Block | Looks like | Rule |
|---|---|---|
| Plain line | some text | Anything that is not one of the blocks below. |
| Blank line | (nothing) | Empty, or only whitespace. |
| Heading | # Title | One to six #, then a space. No indent. |
| Bullet | - item | -, * or +, then a space. May be indented. |
| Numbered item | 1. item | Digits, then . or ), then a space. May be indented. |
| Task | - [ ] item | A bullet followed by [ ], [x] or [X], then a space. |
| Quote | > text | >, then a space. A > alone on a line is an empty quote line. |
| Divider | --- | Three or more of the same character, -, * or _, and nothing else on the line. No indent. |
| Code fence | ``` | See Code fences. |
| Front matter | --- on line 1 | See Front matter. |
| Table | | a | b | | See Tables. |
A marker needs a space
A block marker in Linedown counts only once a space or a tab follows it. Until then, the line is plain text.
- plain line- milk bullet# plain line#tag plain line holding a tag# Title heading>quote plain lineThe one exception is > alone on a line, which is an empty quote line. Quoted text often uses it as the gap between two quoted passages.
A task needs a bullet marker, and a space after the box: - [ ] with nothing after it is a bullet whose text is [ ], and 1. [ ] item is a numbered item whose text starts with [ ].
Headings and dividers can’t be indented
A heading or a divider in Linedown starts at the first column of its line. An indented # Title or --- is a plain line.
Closing hashes are not special: # Title # is a heading with the text Title #. Seven or more # make a plain line.
A divider has nothing else on its line, spaces included: - - - is a bullet with the text - -, and --- followed by a space is a plain line.
Lists
A list item in Linedown is one line. A plain line under a bullet is its own line and does not belong to the bullet, indented or not.
- buy milk the oat kindThese are two lines: a bullet and an indented plain line. Each stands alone.
The file keeps the indent, and the screen shows a level. A line’s indent is the width of its leading whitespace: a space is 1 column and a tab is 4. A list item nests under the nearest item above it that has a smaller indent, and the item’s level is the number of items it is nested under. The same three-level list written with tabs, with two spaces, or with four spaces draws at the same levels, and reading a list never rewrites its whitespace.
An unevenly indented list still gets sensible levels:
- A - B - CB and C both draw one level in, because each is nested under A only. A list’s first item is at the top level even when it starts indented.
Blank lines keep a list open, so an indented item after a blank line still nests under the items above the gap. An indented plain line is drawn at the level its indent would give a list item, without joining any item. An unindented plain line, a heading, a divider, a table or a code fence ends the list, and an indented item after one of those starts again at the top level. A list inside a quote nests on its own, separately from the lines outside the quote.
Numbers show as typed. 3. item shows a 3, whatever is above it. Linedown renumbers nothing when it reads a note. The editor does renumber the items after an edit to a numbered list, such as pressing Enter in the middle of one or indenting an item.
Quotes
Every quoted line in Linedown needs its own >. A plain line under a quoted line is not part of the quote.
> quotednot quotedQuotes nest with >> or > >.
Several markers on one line
A line in Linedown may start with any number of >, then at most one heading or list marker, then text.
> - item a quoted bullet> # Title a quoted heading- # Title a bullet with the text "# Title"- > text a bullet with the text "> text"> --- a quoted line with the text "---"Code fences
A code fence in Linedown opens with three or more backticks or tildes, and closes with a line of the same character, at least as many of them. Text after the opening fence is its info string: a language, then options.
```jslet x = 1```- Inside a fence, nothing is read as markdown.
- The code keeps its own whitespace.
- A fence with no closing line runs to the end of the note.
- The opening fence may be indented, for example under a bullet. The fence is still a code block at the top level of the note, not part of the list item, and FUTO Notes draws it at the left margin. A code line that starts with the same leading whitespace as the opening fence shows without it, so code indented past the fence keeps its extra indent. A code line with less or different leading whitespace shows whole.
- A fence is not recognized after
>. Inside a quote, backticks are quoted text. - Indented text is never code. Code is fences only.
The info string is everything after the opening fence, as in ```go name:api handlers.go hl:1,3-4 ll:2:
- The language is the first word, with its case kept:
```python extraispython. - An option is
name:,hl:orll:and its value. A key counts only at the start of the info string or after whitespace:```hl:2has no language, andname:notes.hl:3.gois one name. - A value runs to the next key, trimmed, so
name:can hold spaces. A key written twice keeps its last value. hl:(highlight) andll:(lowlight) mark lines, counted from 1 at the block’s first code line. Their value is a list of items separated by commas: a number (3) or a range (2-4;9-7reads as7-9). An item that is neither, or that reaches below line 1, is ignored. A line in both lists is highlighted, and numbers past the block’s last line mark nothing.- Any other text in the info string means nothing and stays in the file.
In FUTO Notes 2.0, desktop and Android show a code block’s name: and language in the block’s header, and iPhone and iPad show the language. No platform draws the hl: and ll: line marks yet. The options are read and stay in the file exactly as written.
Front matter
Front matter in Linedown is the lines between a first line that is exactly --- and a later line that is exactly ---. With no closing ---, the note has no front matter: line 1 is a divider and every line is read as usual. A --- anywhere else is a divider.
Both lines must be --- and nothing else. A first line of --- followed by a space or other text, or a first line of +++, opens no front matter.
FUTO Notes shows front matter as a read-only panel above the note and never changes it. See front matter in the file format.
Tables
A table in Linedown is three things in a row:
- a header line starting with
|, - a delimiter row directly under it, such as
|---|---|, - every following line that starts with
|, up to the first line that does not.
| item | qty ||------|----:|| milk | 2 || eggs | 12 |- Every row starts with
|, the delimiter row included. - Colons in the delimiter row set alignment:
:---left,:---:center,---:right. - Cells hold inline text only.
\|is a literal pipe, inside inline code too. - A row with too few cells is padded. Cells past the header show as new columns, so the table is as wide as its widest row.
- Tables are read only at the top level, not inside quotes or lists.
- Until the delimiter row exists,
| item | qty |is a plain line. - A blank line ends a table.
Inline marks
Inline marks in Linedown open and close on the same line. A line break ends them.
| Mark | Looks like |
|---|---|
| Bold | **text** or __text__ |
| Italic | *text* or _text_ |
| Strikethrough | ~~text~~ |
| Inline code | `text` |
| Link | [text](url) |
| Bare URL | https://example.com, www.example.com, or <https://example.com> |
| Image |  |
| Wikilink | [[note]] |
| Tag | #tag |
| Escape | \* shows a literal * |
The rules for when *, _ and ~ open and close are CommonMark’s, applied to one line. So snake_case_word is not italic, and a single ~ on each side is not strikethrough.
Inline code shows as code only. Bold, italic and strikethrough marks around inline code do not reach its text: **a `b` c** shows a and c bold and b as plain code.
Bold left open on one line is literal text. It does not carry to the next line:
**this is not boldand neither is this**A link can’t cross a line either: [text on one line and ](url) on the next are two plain lines.
A backslash escapes punctuation only. Before a letter, as in a\b, a backslash is a backslash.
Differences from CommonMark and GFM
Linedown reads the same characters as CommonMark and GFM, and differs wherever CommonMark lets one line change another or folds lines together.
| Text | CommonMark and GFM | Linedown |
|---|---|---|
title with ---, === or - under it | Heading | Plain line, then a divider, plain line or bullet |
foo then bar on the next line | One paragraph; many renderers join the lines | Two lines |
| Several blank lines in a row | Collapsed to one gap | Shown as written |
**`code`** | Bold code | Code only |
| Plain line under a bullet | Part of the bullet | Its own line |
Plain line under a > line | Part of the quote | Its own line, not quoted |
| Text indented 4 spaces | Code block | Plain line, or list nesting |
**bold across two lines | Bold | Literal asterisks |
1. 1. 1. | Shows 1, 2, 3 | Shows 1, 1, 1 |
- or # with nothing after | Empty bullet, empty heading | Plain line |
>text with no space | Quote | Plain line |
| Table row with no leading pipe | Table row | Plain line |
- - - | Divider | Bullet |
A fence after > | Code block inside the quote | Quoted lines of text |
Markdown that Linedown shows as plain text
Linedown version 1, the version in FUTO Notes 2.0, gives these no meaning and shows them as the literal text you typed:
- Setext headings (a line of
===or---under text) - Reference links (
[text][ref]with a definition elsewhere in the note) - Footnotes
- Raw HTML
- HTML entities such as
& - Indented code blocks
- Hard-break spellings: a trailing backslash shows as
\, and trailing spaces are spaces
None of these are changed in the file. A note that uses them still works in the app that wrote it.
What Linedown does to your files
Linedown changes nothing in your files. Notes stay .md files, FUTO Notes never rewrites a file to fit Linedown’s rules, and it adds nothing to a file to make other apps agree with it. Opening a note writes nothing, and an edit changes only the lines it touches. See the file format.
Other markdown apps may show the same note differently, most often by joining lines that Linedown keeps apart.
Notes written in another app
A note written in another markdown app opens in FUTO Notes unchanged, and most of it reads the same. What differs is syntax that depends on neighboring lines:
- Hard-wrapped paragraphs show as separate lines, because every line break is a line break.
- A list item or quote continued on the next line is a bullet or quoted line followed by a plain line. Put a
>on every quoted line. - Headings underlined with
===or---are plain lines. Use#. - Code made by indenting four spaces is plain text. Use a code fence.
- Table rows without a leading
|are plain lines. - A numbered list written
1.1.1.shows 1, 1, 1. - Footnotes, reference links, raw HTML and entities show as typed.
Going the other way, a CommonMark app may join the separate lines of a note written in FUTO Notes, turn a line into a heading when a --- divider sits directly under it, and read a line indented four spaces as code. Leave a blank line above a divider if the note has to read the same in both.
For Obsidian’s own syntax, such as embeds, aliases and callouts, see Use FUTO Notes with an Obsidian vault.
Why not CommonMark
FUTO Notes left CommonMark because, in CommonMark, a line can change what its neighbors mean. An editor built on CommonMark has two choices when that rule would misread what you typed: show you the wrong thing, or quietly write extra characters into your note to prevent it. The FUTO Notes editors before 2.0 did the second. These are things those editors wrote into notes that nobody typed.
You type a line that starts with two spaces:
one twoThe file gets an HTML entity, because CommonMark drops leading spaces and reads four of them as code:
one  twoYou type a lone # on a line. The file gets #, so that the line cannot become an empty heading.
You insert a divider under a line of text. The file gets ***, not the --- you asked for, because --- would turn the line above into a heading.
You make two lists with a gap between them. The second list’s bullets are switched from - to *, because CommonMark would otherwise merge the two lists into one.
You add an empty bullet under a line of text. A blank line is inserted above it, because the lone - would turn the line above into a heading.
Each of these is a patch over one rule: a line’s meaning can depend on the lines around it. Every patch leaves text in the file that the author did not write and that other apps display. Linedown removes the rule, so the patches have nothing to fix. A note holds what you typed.
Next steps
- Markdown in FUTO Notes: the toolbar, the
/menu, tables, code blocks, and images. - File format: how notes are saved on disk, and what FUTO Notes ignores.
- Use FUTO Notes with an Obsidian vault: what carries over from Obsidian and what doesn’t.
- The Linedown spec for 2.0.0: the engineering copy, with its test cases in the same repository.
- Download FUTO Notes to see how your own notes read.