Repository navigation
Closed
Description
Description
Hi! I use MarkEdit with Obsidian vaults and added Obsidian flavored markdown support to MarkEdit-preview locally. It's working well for me, and I'd like to contribute it upstream. As the README asks, I'm opening this to discuss before sending a PR.
What it adds
| Syntax | Rendering |
|---|---|
> [!faq] Title |
Callouts with all Obsidian types and aliases, custom titles with inline markdown, nesting; unknown types fall back to note |
> [!tip]- / > [!tip]+ |
Foldable callouts (<details>), collapsed or expanded |
==text== |
<mark> highlights |
%%comment%%, multi-line %% blocks |
Hidden |
#tag, #nested/tag |
Tag pills (not links, so they don't collide with heading anchors) |
text ^block-id |
Identifier hidden, used as the block's id |
[[#Heading]], [[#^block-id]] |
Links within the same note |
![[image.png|300x200]] |
Images, with optional size, resolved relative to the current file |
![[Note]] |
Rendered as a link |
GitHub alerts (> [!NOTE]) render exactly as before: same markdown-alert markdown-alert-<type> classes, and the GitHub types keep their colors.
How it's built
- One markdown-it plugin (
src/features/obsidian.ts) with block, inline and core rules. The source is never rewritten, sodata-line-from/data-line-to, sync scroll, task toggling andheadingLineForAnchorare unaffected. Code spans and fences are skipped automatically. - Callouts replace
markdown-it-github-alerts. It ends a callout at the firstblockquote_close, which produces unbalanced HTML for nested callouts. The replacement matches by nesting level. - Styles live in
styles/obsidian/base.cssand use the active theme's color variables where possible. They're added to both the live pane and styled HTML export, and skipped whenthemeNameis"none". - Plain
[[wikilinks]]are left as text, so extensions like MarkEdit-wikilinks can resolve them across a vault. Their contents are kept intact (e.g.[[__init__]]isn't turned into bold). - Tests:
tests/obsidian.test.ts(27 cases). Typecheck and lint pass, and existing tests are unchanged. - Mixed mode isn't touched.
Optional second part: wikilinks in Quick Look
Quick Look can't load other extensions, so wikilinks show as raw [[…]] there. A small follow-up (~260 lines) would:
- render
[[target|alias]]as links in the Quick Look preview (lite hosts only), and - highlight wikilinks in the Quick Look source view using the CSS Custom Highlight API. This paints ranges without touching CodeMirror's DOM; it needs macOS 14.2+ and does nothing on older systems.
Questions
- Is this in scope for the extension? Would you like it as is, behind a setting, or split up differently?
- Note embeds (
![[Note]]) use theme-wikilinkclass anddata-wikilink-targetattribute from MarkEdit-wikilinks, so its click handler can open them. Is that coupling OK, or would you prefer a neutral class? - Do you want the Quick Look part, and if so, as a separate PR?
markdown-it-github-alertsbecomes unused. Should the PR also remove it frompackage.jsonandyarn.lock?
Happy to adjust anything. Thanks for MarkEdit!
Metadata
Metadata
Assignees
Labels
No labels
Activity
cyanzhong commentedon Oct 26, 2026
Sorry I don't like non-standard inventions, especially not in core extensions like this one.
When someone uses these in one app and cannot migrate them to another app, this is lock-in.
Fork as markedit-preview-obsidian with Obsidian flavored markdown