tree-sitter-markdown-updated

Crates.iotree-sitter-markdown-updated
lib.rstree-sitter-markdown-updated
version0.1.0
created_at2025-09-11 20:54:51.245429+00
updated_at2025-09-11 20:54:51.245429+00
descriptionMarkdown grammar for tree-sitter
homepage
repositoryhttps://github.com/c-gamble/tree-sitter-markdown
max_upload_size
id1834547
size1,844,740
Cooper Gamble (c-gamble)

documentation

README

tree-sitter-markdown

npm crates build

Markdown (CommonMark Spec v0.29-gfm) grammar for tree-sitter

Note: This grammar is based on the assumption that link label matchings will never fail since reference links can come before their reference definitions, which causes it hard to do incremental parsing without this assumption.

Changelog

Install

npm install tree-sitter-markdown tree-sitter

Usage

const Parser = require("tree-sitter");
const Markdown = require("tree-sitter-markdown");

const parser = new Parser();
parser.setLanguage(Markdown);

const sourceCode = `
# foo
-     bar
  baz
`;

const tree = parser.parse(sourceCode);
console.log(tree.rootNode.toString());
// (document
//   (atx_heading
//     (atx_heading_marker)
//     (heading_content
//       (text)))
//   (tight_list
//     (list_item
//       (list_marker)
//       (indented_code_block
//         (text))
//       (paragraph
//         (text)))))

License

MIT © Ika

Commit count: 52

cargo fmt