Skip to content

ObsidianQuirkFlags

The quirks: where Obsidian reads valid CommonMark differently. Each flag takes two values, the CommonMark behaviour (COMMONMARK_QUIRKS), which every preset keeps, and Obsidian’s (OBSIDIAN_QUIRKS).

Import:

import type { ObsidianQuirkFlags } from '@mnaoumov/obsidian-markdown-parser';

Signature:

export interface ObsidianQuirkFlags

Properties

PropertyTypeDescription
autolink'commonmark' | 'obsidian'Which autolinks there are. CommonMark: a scheme of 2 to 32 letters, digits, +, . and -, then a :, or an email address of the characters HTML allows. Obsidian: a <, then a scheme of any characters but whitespace and @ with :// and more after it, or any non-whitespace with an @ in it, then a >. A mailto: address shows without its scheme.
characterReference'commonmark' | 'obsidian'Which character references inline content holds. CommonMark: a ; ends each, a name must be one HTML defines, and a numeric reference takes up to seven decimal or six hexadecimal digits. Obsidian: a numeric reference takes any number of digits and needs no ;, and a named one without its ; takes the longest of HTML's legacy names it starts with (&copy, &nbsp). A numeric reference past the last code point is U+FFFD.
emptyListItem'cannot-interrupt' | 'interrupts-paragraph'Whether an empty list item can interrupt a paragraph. CommonMark: it cannot, so foo\n* is one paragraph. Obsidian: *, +, - and 1. with nothing after them end the paragraph and open a list, wherever the line is not a setext heading's underline.
gfmTable'commonmark' | 'obsidian'How a GFM table is read. GFM: its header and delimiter rows have as many cells, it can interrupt a paragraph, and it runs to a blank line or another block. \| is a pipe in any cell content. Obsidian: its rows agree with the header on whether they start with a pipe, and the delimiter row gives the columns, to which every row is cut or padded. It interrupts no paragraph, and runs to a line that holds no pipe after its first character or disagrees on the leading pipe. Its cells are read as written, so \| in a code span keeps its backslash.
htmlBlock'commonmark' | 'obsidian'Which lines open an HTML block, and what ends it. CommonMark 0.31.2: its seven kinds. Obsidian: the first kind is <script>, <pre> and <style>, with no <textarea>; the sixth kind's tags have no search and add hgroup, meta, pre and source, so </pre> interrupts a paragraph; and the sixth and seventh kinds end at an empty line, not at a line of whitespace.
htmlComment'commonmark' | 'obsidian'Which raw inline HTML comments there are. CommonMark 0.31.2: <!-->, <!--->, and any text between <!-- and the first -->. Obsidian, as CommonMark 0.30: the text does not start with > or ->, does not end with -, and holds no --. Any other <!-- is text.
linkDefinition'commonmark' | 'obsidian'How a link reference definition is read. CommonMark: a title that does not end its line leaves the definition without one, and a setext underline below a definition is text. Obsidian: such a title spoils the definition, so it is a paragraph; a title holds no escaped quote and starts no line with its closing quote; <> is no destination, and a label may hold brackets; and a definition of one line with a setext underline below it is a heading. A definition runs over no blank line, though Obsidian's may.
listItem'commonmark' | 'obsidian'How list items are structured. CommonMark: an ordered marker has at most nine digits, an item whose first line is empty has its content a column after its marker and ends at a blank line, a line indented less than an item's content ends it, and a marker indented four or more columns opens no item. Obsidian: an ordered marker has any number of digits; an item whose first line is empty has its content right after its marker, and a blank line does not end it; a line indented more than four columns, though less than the item's content, continues the item; and a marker of the same list indented less than the item's content opens the next item, however far it is indented.
looseList'between-blocks' | 'blank-line-anywhere'When a list is loose, its items' paragraphs rendered in <p>. CommonMark: when a blank line separates two of its items, or two blocks directly inside one item. Obsidian: when a blank line anywhere inside it is followed by more of it, in a nested list or in fenced code as well.
setextHeading'multi-line' | 'single-line'How a setext heading is written. CommonMark: its text may run over several lines, and its underline may be indented up to three spaces and followed by whitespace. Obsidian: its text is one line, and its underline starts its line and has nothing after it. A paragraph of more lines keeps a === line as text, and a --- line after it is a thematic break.
softLineBreak'hard-break' | 'line-ending'What a line ending inside a paragraph is. CommonMark: a soft line break, rendered as a line ending. Obsidian, with its default strictLineBreaks: false: a hard line break.

Links to this page: