在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):ikatyang/tree-sitter-markdown开源软件地址(OpenSource Url):https://github.com/ikatyang/tree-sitter-markdown开源编程语言(OpenSource Language):C++ 96.2%开源软件介绍(OpenSource Introduction):tree-sitter-markdownMarkdown (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. Installnpm install tree-sitter-markdown tree-sitter Usageconst 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))))) LicenseMIT © Ika |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论