{"name":"@textlint/markdown-to-ast","version":"15.8.0","description":"Parse Markdown to AST with location info.","homepage":"https://github.com/textlint/textlint/tree/master/packages/@textlint/markdown-to-ast/","bugs":{"url":"https://github.com/textlint/textlint/issues"},"repository":{"type":"git","url":"git+https://github.com/textlint/textlint.git"},"license":"MIT","author":{"name":"azu"},"type":"commonjs","main":"lib/src/index.js","types":"lib/src/index.d.ts","directories":{"test":"test/"},"scripts":{"build":"tsc -b","clean":"rimraf lib/","prepack":"npm run --if-present build","test":"vitest run","test:watch":"vitest watch","updateSnapshot":"npm run build && node tools/update-fixtures.js","watch":"tsc -b --watch"},"dependencies":{"@textlint/ast-node-types":"15.8.0","debug":"^4.4.3","mdast-util-gfm-autolink-literal":"^0.1.3","neotraverse":"^0.6.18","remark-footnotes":"^3.0.0","remark-frontmatter":"^3.0.0","remark-gfm":"^1.0.0","remark-parse":"^9.0.0","structured-source":"^4.0.0","unified":"^9.2.2"},"devDependencies":{"@textlint/ast-tester":"15.8.0","@types/debug":"^4.1.13","@types/node":"^24.13.3","@types/unist":"^3.0.3","rimraf":"^6.1.3","typescript":"~5.8.3","vitest":"^3.2.7"},"publishConfig":{"access":"public"},"gitHead":"4ba5bfedb27e86ffc12558743e5840eb57d13302","_id":"@textlint/markdown-to-ast@15.8.0","_nodeVersion":"22.23.1","_npmVersion":"lerna/4.11.5/node@v22.23.1+x64 (linux)","dist":{"integrity":"sha512-gWOcd2+UCqODMLGIIY5WiPE9zmR9L4aut3FIkxH8gSCiZ6EVkBaU2mgm+8KiGOjJqdtT98xkWocCwDtQ1kypOQ==","shasum":"d827b78199e2ab8a69d2f3e47a4e5fd9dcc23665","tarball":"http://registry-npm.ywwl.com/@textlint/markdown-to-ast/download/@textlint/markdown-to-ast-15.8.0.tgz","fileCount":18,"unpackedSize":47343,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@textlint%2fmarkdown-to-ast@15.8.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAPuHiM8iqQsR9CAS6vERRwOzcqPn8a8aB1oPFhul29YAiAsyABKhn2Nu2gr5HaaRZA/CSUgc6ku24lWSW4+9aiSSA=="}],"size":13412,"noattachment":false,"key":"/@textlint/markdown-to-ast/-/@textlint/markdown-to-ast-15.8.0.tgz"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1ba57113-456b-4b41-855c-513bf0faadfc"}},"maintainers":[{"name":"azu","email":"azuciao@gmail.com"},{"name":"textlint-user","email":"azuciao+textlint@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/markdown-to-ast_15.8.0_1785557782756_0.5949092487345733"},"_hasShrinkwrap":false,"readme":"# @textlint/markdown-to-ast\n\nParse Markdown to AST with location info.\n\nThis library is not parser itself, it dependent on [wooorm/remark](https://github.com/wooorm/remark).\n\n> Markdown -> remark -> markdown-to-ast -> `TxtNode`s\n\nThe AST consists of `TxtNode`s.\nA `TxtNode` of the AST has following properties:\n\n- `loc` - Nodes have line and column-based location info.\n- `range` - Nodes have an index-based location range (array).\n- `raw` - Node have a `raw` text.\n- `value` - Node have a `value` of text.\n\nThe interface are defined in [textlint/txtnode.md](https://github.com/textlint/textlint/blob/master/docs/txtnode.md \"textlint/txtnode.md at master · textlint/textlint\")\n\nThis library is a part of [textlint/textlint](https://github.com/textlint/textlint \"textlint/textlint\").\n\n**If you need to markdown parser, please use [wooorm/remark](https://github.com/wooorm/remark) directly.**\n\n## DEMO\n\n- [textlint AST explorer](https://textlint.org/astexplorer/ \"textlint AST explorer\")\n\n## Installation\n\n```\nnpm install @textlint/markdown-to-ast\n```\n\n## Usage\n\n```sh\nvar parse = require(\"@textlint/markdown-to-ast\").parse;\nvar markdown = \"It's a *text*\";\nvar AST = parse(markdown);\n/*\n{\n    \"type\": \"Document\",\n    \"children\": [\n        {\n            \"type\": \"Paragraph\",\n            \"children\": [\n                {\n                    \"type\": \"Str\",\n                    \"value\": \"It's a \",\n                    \"loc\": {\n                        \"start\": {\n                            \"line\": 1,\n                            \"column\": 0\n                        },\n                        \"end\": {\n                            \"line\": 1,\n                            \"column\": 7\n                        }\n                    },\n                    \"range\": [\n                        0,\n                        7\n                    ],\n                    \"raw\": \"It's a \"\n                },\n                {\n                    \"type\": \"Emphasis\",\n                    \"children\": [\n                        {\n                            \"type\": \"Str\",\n                            \"value\": \"text\",\n                            \"loc\": {\n                                \"start\": {\n                                    \"line\": 1,\n                                    \"column\": 8\n                                },\n                                \"end\": {\n                                    \"line\": 1,\n                                    \"column\": 12\n                                }\n                            },\n                            \"range\": [\n                                8,\n                                12\n                            ],\n                            \"raw\": \"text\"\n                        }\n                    ],\n                    \"loc\": {\n                        \"start\": {\n                            \"line\": 1,\n                            \"column\": 7\n                        },\n                        \"end\": {\n                            \"line\": 1,\n                            \"column\": 13\n                        }\n                    },\n                    \"range\": [\n                        7,\n                        13\n                    ],\n                    \"raw\": \"*text*\"\n                }\n            ],\n            \"loc\": {\n                \"start\": {\n                    \"line\": 1,\n                    \"column\": 0\n                },\n                \"end\": {\n                    \"line\": 1,\n                    \"column\": 13\n                }\n            },\n            \"range\": [\n                0,\n                13\n            ],\n            \"raw\": \"It's a *text*\"\n        }\n    ],\n    \"loc\": {\n        \"start\": {\n            \"line\": 1,\n            \"column\": 0\n        },\n        \"end\": {\n            \"line\": 1,\n            \"column\": 13\n        }\n    },\n    \"range\": [\n        0,\n        13\n    ],\n    \"raw\": \"It's a *text*\"\n}\n*/\n```\n\nIf you want to know real use-case, please see [textlint/textlint](https://github.com/textlint/textlint \"textlint/textlint\").\n\n## Tests\n\n```\nnpm test\n```\n\n### Create fixtures\n\nSee [tools/](tools/) directory.\n\n## Contributing\n\n1. Fork it!\n2. Create your feature branch: `git checkout -b my-new-feature`\n3. Commit your changes: `git commit -am 'Add some feature'`\n4. Push to the branch: `git push origin my-new-feature`\n5. Submit a pull request :D\n\n## License\n\nMIT\n","publish_time":1785557782930,"_cnpm_publish_time":1785557782930,"dist-tags":{"beta":"12.0.0-beta.3","canary":"6.1.0-alpha.0f2fd6f9","latest":"15.8.0","next":"13.4.2-next.0"}}