{"id":16625499,"url":"https://github.com/aleclarson/markdown-ast","last_synced_at":"2025-08-03T15:39:49.631Z","repository":{"id":50663512,"uuid":"158417200","full_name":"aleclarson/markdown-ast","owner":"aleclarson","description":"Tiny markdown parser","archived":false,"fork":false,"pushed_at":"2022-07-22T19:07:58.000Z","size":80,"stargazers_count":41,"open_issues_count":7,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-03T11:36:55.303Z","etag":null,"topics":["ast","markdown","parser"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aleclarson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-20T16:11:01.000Z","updated_at":"2025-03-16T05:09:57.000Z","dependencies_parsed_at":"2022-09-24T13:20:27.329Z","dependency_job_id":null,"html_url":"https://github.com/aleclarson/markdown-ast","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/aleclarson/markdown-ast","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleclarson%2Fmarkdown-ast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleclarson%2Fmarkdown-ast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleclarson%2Fmarkdown-ast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleclarson%2Fmarkdown-ast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aleclarson","download_url":"https://codeload.github.com/aleclarson/markdown-ast/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aleclarson%2Fmarkdown-ast/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259952457,"owners_count":22936956,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ast","markdown","parser"],"created_at":"2024-10-12T04:05:55.362Z","updated_at":"2025-06-15T09:35:03.809Z","avatar_url":"https://github.com/aleclarson.png","language":"JavaScript","readme":"# markdown-ast\n\n[![npm](https://img.shields.io/npm/v/markdown-ast.svg)](https://www.npmjs.com/package/markdown-ast)\n[![Build status](https://travis-ci.org/aleclarson/markdown-ast.svg?branch=master)](https://travis-ci.org/aleclarson/markdown-ast)\n[![Coverage status](https://coveralls.io/repos/github/aleclarson/markdown-ast/badge.svg?branch=master)](https://coveralls.io/github/aleclarson/markdown-ast?branch=master)\n[![Bundle size](https://badgen.net/bundlephobia/min/markdown-ast)](https://bundlephobia.com/result?p=markdown-ast)\n[![Install size](https://packagephobia.now.sh/badge?p=markdown-ast)](https://packagephobia.now.sh/result?p=markdown-ast)\n[![Code style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://paypal.me/alecdotbiz)\n\nFork of [snarkdown](https://github.com/developit/snarkdown) that returns an\narray of AST nodes, instead of an HTML string.\n\nTypeScript support included!\n\n```ts\nimport md from 'markdown-ast'\n\nconst ast = md(code)\n```\n\nThe goal is to support **Github-style markdown**.\nPlease file an issue if you run into any inconsistencies.\n\n\u0026nbsp;\n\n## Notable behavior\n\n- Node locations are _not_ tracked.\n- No HTML parsing. Embedded HTML is plain text.\n- Single `\\n` chars are removed from the start/end of plain text.\n\n\u0026nbsp;\n\n## Node types\n\nEvery node has a `type` property equal to one of these:\n\n- `bold`: `__text__` or `**text**`\n- `border`: 3+ character sequence of `[*-_]` w/ optional spaces between\n- `break`: `\\n\\n` or `\\r\\n\\r\\n` or `\\s\\s\\n` or `\\s\\s\\r\\n`\n- `codeBlock`: triple backticks or 4-spaces/tab indented\n- `codeSpan`: inline backticks\n- `image`: `![alt](url)` or `![alt][key]` or just `![altAsKey]`\n- `italic`: `_text_` or `*text*`\n- `link`: `[text](url)` or `[text][key]` or just `[textAsKey]`\n- `linkDef`: `[key]: url`\n- `list`: markdown w/ `[-+*]|\\d+[\\.\\)]` prefix\n- `quote`: markdown w/ `\u003e` prefix\n- `strike`: `~~text~~`\n- `text`\n- `title`: markdown w/ `#{1,6}` prefix or underlined w/ 3+ `=|-` symbols\n\nAvailable properties are defined [here](./index.d.ts).\n\n\u0026nbsp;\n\n## Block nodes\n\n\"Block nodes\" have a `block` property containing any nested nodes. Blocks are\nauto-closed when their parent block is closed (unless the nested block is\nalready closed, of course).\n\nSome nodes (which may not be blocks) auto-close **all** open blocks. These\ninclude `border`, `break`, `list`, `quote`, and `title` nodes.\n\n\"Inline blocks\" can be used anywhere in the document. These include `bold`,\n`codeSpan`, `image`, `italic`, `link`, and `strike` nodes.\n\n\"Recursive blocks\" use their own parsing context to process any nested nodes.\nThese include `list`, `quote`, and `title` nodes.\n","funding_links":["https://paypal.me/alecdotbiz"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleclarson%2Fmarkdown-ast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faleclarson%2Fmarkdown-ast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleclarson%2Fmarkdown-ast/lists"}