https://github.com/jstransformers/jstransformer-marked
Marked support for JSTransformers.
https://github.com/jstransformers/jstransformer-marked
Last synced: 10 months ago
JSON representation
Marked support for JSTransformers.
- Host: GitHub
- URL: https://github.com/jstransformers/jstransformer-marked
- Owner: jstransformers
- License: mit
- Created: 2014-11-18T15:11:49.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2023-07-18T20:50:02.000Z (almost 3 years ago)
- Last Synced: 2025-08-05T22:42:12.797Z (11 months ago)
- Language: JavaScript
- Homepage: http://npmjs.com/jstransformer-marked
- Size: 545 KB
- Stars: 8
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
- License: LICENSE.md
Awesome Lists containing this project
README
# jstransformer-marked
[Marked](http://npm.im/marked) support for [JSTransformers](http://github.com/jstransformers).
[![Build Status][ci-badge]][ci-url]
[](https://codecov.io/gh/jstransformers/jstransformer-marked)
[](https://www.npmjs.org/package/jstransformer-marked)
## Installation
npm install jstransformer-marked
## API
```js
const marked = require('jstransformer')(require('jstransformer-marked'));
marked.render('# Hello World!').body
//=> '
Hello World!
'
const markedOptions = {}
marked.render('# "Hello World"', markedOptions)
// also supports async walkTokens
marked.renderAsync('# Hello World', {
walkTokens: async (token) => {
const uriPrefix = await uriPrefixAsync()
if (token.href) {
token.href = uriPrefix + token.href
}
}
})
```
For all supported options see https://marked.js.org/using_advanced#options
## License
MIT
[ci-badge]: https://github.com/jstransformers/jstransformer-marked/actions/workflows/test.yml/badge.svg
[ci-url]: https://github.com/jstransformers/jstransformer-marked/actions/workflows/test.yml