fix: Obsidian flavored markdown

This commit is contained in:
saberzero1 2026-02-15 23:53:57 +01:00
parent ea352385f9
commit 57e60726b6
No known key found for this signature in database
3 changed files with 182 additions and 4 deletions

View File

@ -12,6 +12,183 @@ It also ships with support for [frontmatter parsing](https://help.obsidian.md/Ed
Finally, Quartz also provides [[CrawlLinks]] plugin, which allows you to customize Quartz's link resolution behaviour to match Obsidian. Finally, Quartz also provides [[CrawlLinks]] plugin, which allows you to customize Quartz's link resolution behaviour to match Obsidian.
## Supported Features
### Wikilinks
Internal links using the `[[page]]` syntax are converted to regular links. See [[wikilinks]] for more details. All variations are supported:
```markdown
[[Page]] Link to a page
[[Page|Custom text]] Link with alias
[[Page#Heading]] Link to a heading
[[Page#Heading|Custom text]] Link to a heading with alias
[[Page#^block-id]] Link to a block reference
![[Page]] Embed (transclude) a page
![[image.png]] Embed an image
![[image.png|alt 100x200]] Embed with alt text and dimensions
```
Inside tables, pipes in wikilinks can be escaped with a backslash:
```markdown
| Column |
| --------------- |
| [[page\|alias]] |
```
### Highlights
Wrap text in `==` to highlight it:
```markdown
This is ==highlighted text== in a sentence.
```
This renders as: This is ==highlighted text== in a sentence.
### Comments
Obsidian-style comments are stripped from the output:
```markdown
This is visible. %%This is a comment and won't appear.%%
```
This renders as: This is visible. %%This is a comment and won't appear.%%
Multi-line comments are also supported:
```markdown
%%
This entire block
is a comment.
%%
```
### Tags
Tags starting with `#` are parsed and linked to tag pages:
```markdown
#tag #nested/tag #tag-with-dashes
```
For example: #feature/transformer
> [!note]
> Pure numeric tags like `#123` are ignored, matching Obsidian behaviour.
### Callouts
[[callouts|Obsidian callouts]] are fully supported, including collapsible variants:
```markdown
> [!note]
> This is a note callout.
> [!warning]- Collapsed by default
> This content is hidden initially.
> [!tip]+ Expanded by default
> This content is visible initially.
```
> [!example] Live example
> This is a live callout rendered from Obsidian-flavored Markdown.
All built-in callout types are supported: `note`, `abstract`, `info`, `todo`, `tip`, `success`, `question`, `warning`, `failure`, `danger`, `bug`, `example`, and `quote`, along with their aliases.
### Task Lists and Custom Task Characters
Standard checkboxes work out of the box. With `enableCheckbox: true`, you also get support for custom task characters that are popular in the Obsidian community:
```markdown
- [ ] Unchecked
- [x] Checked
- [?] Question
- [!] Important
- [>] Forwarded
- [/] In progress
- [-] Cancelled
- [s] Special
```
Each custom character is preserved as a `data-task` attribute on the rendered element, allowing CSS-based styling per character.
### Mermaid Diagrams
[[Mermaid diagrams|Mermaid]] code blocks are rendered as diagrams:
````markdown
```mermaid
graph TD
A[Start] --> B{Decision}
B -->|Yes| C[OK]
B -->|No| D[Cancel]
```
````
```mermaid
graph TD
A[Start] --> B{Decision}
B -->|Yes| C[OK]
B -->|No| D[Cancel]
```
### YouTube Embeds
YouTube videos can be embedded using standard image syntax with a YouTube URL:
```markdown
![](https://youtu.be/v5LGaczJaf0)
![](https://www.youtube.com/watch?v=v5LGaczJaf0)
```
For example, the following embed is rendered from `![](https://youtu.be/v5LGaczJaf0)`:
![](https://youtu.be/v5LGaczJaf0)
### Tweet Embeds
Tweets from Twitter/X are embedded as static blockquotes with a link to the original:
```markdown
![](https://x.com/kepano/status/1882142872826442145)
![](https://twitter.com/kepano/status/1882142872826442145)
```
For example, the following embed is rendered from `![](https://x.com/kepano/status/1882142872826442145)`:
![](https://x.com/kepano/status/1882142872826442145)
### Block References
Block references allow linking to specific blocks within a page:
```markdown
Content paragraph. ^my-block
[[Page#^my-block]]
```
### Obsidian URI Links
Links using the `obsidian://` protocol are marked with a CSS class (`obsidian-uri`) and a `data-obsidian-uri` attribute, so you can style them differently from regular links.
### Video Embeds
Video files can be embedded using standard image syntax:
```markdown
![](video.mp4)
![](video.webm)
```
### Embed in HTML
By default, Obsidian does not render its Markdown syntax inside HTML blocks. Quartz extends this with the `enableInHtmlEmbed` option, which parses wikilinks, highlights, and tags inside raw HTML nodes.
## Configuration ## Configuration
This functionality is provided by the [[ObsidianFlavoredMarkdown]], [[Frontmatter]] and [[CrawlLinks]] plugins. See the plugin pages for customization options. This functionality is provided by the [[ObsidianFlavoredMarkdown]], [[Frontmatter]] and [[CrawlLinks]] plugins. See the plugin pages for customization options.

View File

@ -17,12 +17,13 @@ This plugin accepts the following configuration options:
- `callouts`: If `true` (default), adds support for [[callouts|callout]] blocks for emphasizing content. - `callouts`: If `true` (default), adds support for [[callouts|callout]] blocks for emphasizing content.
- `mermaid`: If `true` (default), enables [[Mermaid diagrams|Mermaid diagram]] rendering within Markdown files. - `mermaid`: If `true` (default), enables [[Mermaid diagrams|Mermaid diagram]] rendering within Markdown files.
- `parseTags`: If `true` (default), parses and links tags within the content. - `parseTags`: If `true` (default), parses and links tags within the content.
- `parseArrows`: If `true` (default), transforms arrow symbols into their HTML character equivalents.
- `parseBlockReferences`: If `true` (default), handles block references, linking to specific content blocks. - `parseBlockReferences`: If `true` (default), handles block references, linking to specific content blocks.
- `enableInHtmlEmbed`: If `true`, allows embedding of content directly within HTML. Defaults to `false`. - `enableInHtmlEmbed`: If `true`, allows embedding of content directly within HTML. Defaults to `false`.
- `enableYouTubeEmbed`: If `true` (default), enables the embedding of YouTube videos and playlists using external image Markdown syntax. - `enableYouTubeEmbed`: If `true` (default), enables the embedding of YouTube videos and playlists using external image Markdown syntax.
- `enableTweetEmbed`: If `true` (default), enables the embedding of tweets as static blockquotes from Twitter/X URLs.
- `enableVideoEmbed`: If `true` (default), enables the embedding of video files. - `enableVideoEmbed`: If `true` (default), enables the embedding of video files.
- `enableCheckbox`: If `true`, adds support for interactive checkboxes in content. Defaults to `false`. - `enableCheckbox`: If `true`, adds support for interactive checkboxes in content, including custom task characters (e.g. `- [?]`, `- [!]`, `- [/]`). Defaults to `false`.
- `enableObsidianUri`: If `true` (default), marks `obsidian://` protocol links with a CSS class and data attribute for custom styling.
- `disableBrokenWikilinks`: If `true`, replaces links to non-existent notes with a dimmed, disabled link. Defaults to `false`. - `disableBrokenWikilinks`: If `true`, replaces links to non-existent notes with a dimmed, disabled link. Defaults to `false`.
> [!warning] > [!warning]

View File

@ -130,8 +130,8 @@
"obsidian-flavored-markdown": { "obsidian-flavored-markdown": {
"source": "github:quartz-community/obsidian-flavored-markdown", "source": "github:quartz-community/obsidian-flavored-markdown",
"resolved": "https://github.com/quartz-community/obsidian-flavored-markdown.git", "resolved": "https://github.com/quartz-community/obsidian-flavored-markdown.git",
"commit": "44387bec78dae7930c05d8e06399f42bd5c0ec97", "commit": "948807ece23b3fb73934b94e1b30f9a1b678c881",
"installedAt": "2026-02-15T21:16:25.197Z" "installedAt": "2026-02-15T22:38:34.538Z"
}, },
"github-flavored-markdown": { "github-flavored-markdown": {
"source": "github:quartz-community/github-flavored-markdown", "source": "github:quartz-community/github-flavored-markdown",