https://github.com/onmax/render-markdown-it-tokens
https://github.com/onmax/render-markdown-it-tokens
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/onmax/render-markdown-it-tokens
- Owner: onmax
- License: mit
- Created: 2025-02-28T08:42:01.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-28T09:12:14.000Z (over 1 year ago)
- Last Synced: 2025-06-11T03:16:49.235Z (about 1 year ago)
- Language: TypeScript
- Size: 84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# render-markdown-it-tokens
[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![bundle][bundle-src]][bundle-href]
[![JSDocs][jsdocs-src]][jsdocs-href]
[![License][license-src]][license-href]
Render `markdown-it` tokens back to Markdown
## Usage
```
npm install render-markdown-it-tokens
```
```js
import { renderMarkdownItTokens } from 'render-markdown-it-tokens'
const tokens = [
{ type: 'heading_open', tag: 'h1', level: 1 },
{ type: 'inline', content: 'Hello, world!' },
{ type: 'heading_close', tag: 'h1', level: 1 },
]
const markdown = renderMarkdownItTokens(tokens)
console.log(markdown)
// # Hello, world!
```
## License
[MIT](./LICENSE) License © [onmax](https://github.com/onmax)
[npm-version-src]: https://img.shields.io/npm/v/render-markdown-it-tokens?style=flat&colorA=080f12&colorB=1fa669
[npm-version-href]: https://npmjs.com/package/render-markdown-it-tokens
[npm-downloads-src]: https://img.shields.io/npm/dm/render-markdown-it-tokens?style=flat&colorA=080f12&colorB=1fa669
[npm-downloads-href]: https://npmjs.com/package/render-markdown-it-tokens
[bundle-src]: https://img.shields.io/bundlephobia/minzip/render-markdown-it-tokens?style=flat&colorA=080f12&colorB=1fa669&label=minzip
[bundle-href]: https://bundlephobia.com/result?p=render-markdown-it-tokens
[license-src]: https://img.shields.io/github/license/onmax/render-markdown-it-tokens.svg?style=flat&colorA=080f12&colorB=1fa669
[license-href]: https://github.com/onmax/render-markdown-it-tokens/blob/main/LICENSE
[jsdocs-src]: https://img.shields.io/badge/jsdocs-reference-080f12?style=flat&colorA=080f12&colorB=1fa669
[jsdocs-href]: https://www.jsdocs.io/package/render-markdown-it-tokens