npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

lezer-markdown-obsidian

v0.0.3

Published

Obsidian Markdown extensions for @lezer/markdown

Downloads

4

Readme

lezer-markdown-obsidian

This package is a set of extensions for @lezer/markdown to add support for the Obsidian's added markdown syntax.

Warning: This is not the parser that Obsidian itself uses. All parsing is a best attempt to match the way Obsidian parses markdown, and will not guarantee a 1-for-1 replication.

If you recognize a difference in parsing, please open an issue.

parser

The simplest was to use the library if you want full obsidian parsing is to import the parser:

import { parser } from "lezer-markdown-obsidian";

const tree = parser.parse("# Some Markdown");

This parser includes all the extensions below, as well as the Strikethrough and Table extensions from @lezer/markdown.

Extensions

You can configure your own parser with specific extensions:

import { parser as mdParser } from "@lezer/markdown";
import { Comment, InternalLink } from "lezer-markdown-obsidian";

const parser = mdParser.configure([Comment, InternalLink]);

Extensions

An array of all the extensions for Obsidian's markdown syntax.

BlockAndInline

An array of all the extensions except YAML frontmatter.

Comment

This adds support for parsing comments in the form of: %%comment%%.

Comments that begin at the start of a line can span multiple lines, and will go to the end of the document unless terminated.

Comments that are inline must be completed on the same line.

Footnote

This adds support for detecting footnotes and footnote references.

Footnotes are in the form of: This has a footnote.[^1]

References are in the form of: [^1]: Here is some additional info.

References can span multiple lines as long as they are not interrupted by another block.

Hashtag

This adds support for hashtags. Hashtags are pretty flexible in what can be tagged, only forbidding certain special characters.

#this-is-a-tag

#nested/tag

InternalLink

This adds support for internal links and embeds.

Internal links are structured like: [[File#heading|display]]

Internal embeds are structured like: ![[File#heading]]

The #heading and |display parts are optional. Heading can be a #^blockid instead, and multiple headings can be chained together.

Mark

This adds support for highlight marks in the form of ==highlighted==.

TaskList

This adds support for Obsidian's task lists, which allow support for arbitrary characters for tasks. This makes it different from GFM task lists.

Open tasks are in the form of: - [ ] This is an uncompleted task

Completed tasks are in the form of: - [x] This is a completed task

Special tasks can replace x with any character in the completed form.

Tex

This adds support for LaTex style formulas, both inline and block level. In Obsidian, these are rendered with MathJax.

Inline is in the form of: Here is some math: $1 + 2 = 3$

Block level is in the form of:

$$
\vec v = \vec a t
$$

Warning: Obsidian can also parse blocks as inline elements, which is currently not supported.

YAMLFrontmatter

This adds support for a frontmatter block of YAML. The frontmatter must be the first block in the document, otherwise it is treated as markdown. The YAML must be surrounded by lines with ---.

For example:

---
author: Eric
---

If you are parsing subselections of a document, you will want to configure a parser that does not include YAMLFrontmatter, since it will be unable to distinguise horizontal rules from frontmatter.