Package Exports
- marked-ast
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (marked-ast) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
marked-ast
A modified version of marked that can produce an abstract syntax tree for Markdown.
Usage
var marked = require('marked-ast');
var ast = marked.parse('_This is **Markdown**_, he said.');
var html = marked.render(ast);The package is just a wrapper for marked, so the produced HTML should be identical (if it isn't it's a bug). The AST produced in the example would look like this:
[
{
"type": "paragraph",
"text": [
{
"type": "em",
"text": [
"This is ",
{
"type": "strong",
"text": [ "Markdown" ]
}
]
},
", he said."
]
}
]Development
Basic setup:
git clone https://github.com/pdubroy/marked-ast.git
cd marked-ast
npm install
git submodule update --initRunning Tests
Use npm test to run the tests. Before checking code in, run npm run prepublish.
Updating Marked
To update to a new version of marked:
cd third_party/marked
git checkout <REF> # E.g., `git checkout v0.3.3`
cd ../..
npm run rewrite && npm test