This plugin enhances Markdown processing to support GitHub Flavored Markdown (GFM) which adds features like autolink literals, footnotes, strikethrough, tables and tasklists.
In addition, this plugin adds optional features for typographic refinement (such as converting straight quotes to curly quotes, dashes to en-dashes/em-dashes, and ellipses) and automatic heading links as a symbol that appears next to the heading on hover.
For information on how to add, remove or configure plugins, see the Configuration page.
This plugin accepts the following configuration options:
enableSmartyPants: When true, enables typographic enhancements. Default is true.linkHeadings: When true, gives headings theirids and adds a link to each heading. Default is true. Setting it tofalsealso turns off heading ids, so links to headings ([[page#Heading]]) and section embeds no longer reach them (on pages with a table of contents, TableOfContents still gives headings ids).singleTilde: When true (default), text between single tildes (~text~) is struck through, as on GitHub.falsestrikes only~~text~~, as Obsidian does, so a~meaning “about” (~20 W and (~€120)) stays as written. Under ObsidianFlavoredMarkdown‘s defaultlegacypreset, which parses as Obsidian, single tildes never strike.replacements: Text to replace as written, outside code and math, before SmartyPants; the longest match wins. Empty by default: neither GitHub nor Obsidian replaces anything. See Arrows.
Default options
- source: "@quartz-community/github-flavored-markdown"
enabled: true
options:
enableSmartyPants: true
linkHeadings: true
singleTilde: true
replacements: {}
order: 30This plugin must run before ObsidianFlavoredMarkdown (order 30 and 40 in the default config). If you set order on either plugin, keep this one first.
Arrows
Quartz 4 turned typed arrows into arrow characters (parseArrows). Obsidian doesn’t, so Quartz 5 leaves them as typed. To render them as Quartz 4 did:
plugins:
- source: "@quartz-community/github-flavored-markdown"
options:
replacements:
"->": "→"
"-->": "⇒"
"=>": "⇒"
"==>": "⇒"
"<-": "←"
"<--": "⇐"
"<=": "⇐"
"<==": "⇐"Text in code, inline code and math is left alone. Note that <= then also replaces a “less than or equal” written in prose.
Heading ids
Heading ids are made from the heading as written, with the same slug function that links and the table of contents use, and match GitHub’s:
- With SmartyPants on, a heading containing
--keeps it in its id:## Range 1--2→range-1--2(before 5.1:range-12). Links that hard-code the old id need updating;[[page#Range 1--2]]keeps working. - Obsidian writes links to headings containing
:,|,^,#or\with spaces instead ([[note#Colon unspaced]]for## Colon:unspaced). Such headings get an extra anchor (an empty<span class="heading-alias">with that id), so these links and section embeds reach them. - A same-page link written as a heading’s text, such as
[x](<#My Heading>), points at the heading’s id.
API
- Category: Transformer
- Function name:
ExternalPlugin.GitHubFlavoredMarkdown(). - Source:
quartz-community/github-flavored-markdown - Install:
npx quartz plugin add @quartz-community/github-flavored-markdown(included in the default configuration)