1.0.1 • Published 2 years ago
tiny-markdown-parser v1.0.1
tiny-markdown-parser
_ _
| |_(_)_ _ _ _
| _| | ' | || |
\__|_|_||_\_, |_ _
_ __ __ _|__/| |____| |_____ __ ___ _
| ' \/ _` | '_| / / _` / _ \ V V | ' \
|_|_|_\__,_|_| |_\_\__,_\___/\_/\_/|_||_|
_ __ __ _ _ _ ______ _ _
| '_ / _` | '_(_-/ -_| '_|
| .__\__,_|_| /__\___|_|
|_| Tiny ~1.1kB (minified + gzipped) markdown parser with TypeScript typings. It has the same functionality as 1kB snarkdown but also supports tables.
npm install -S tiny-markdown-parserUsage
import { parse } from 'tiny-markdown-parser';
const result = parse('_this_ is **MARKDOWN**');tiny-markdown-parser exports 3 functions, although you mostly want to use parse.
parseturns markdown string into html:inlinereplaces only the inline markup. (bold,italic,underline,strike-trough,line-breaks);inlineBlocktransforms only inline code blocks, links and images
Support
- Headlines:
### Headline - Inline:
*italic*, **bold**, ***bold italic***- `
_code_="- something";` or direct escaping with \ ~underline~, ~~strike through~~, ~~~deleted~~~
- Blocks:
- pre format blocks: surrounded by ```
- blockquotes:
> something
- Anchors:
#[jump-here] - Links:
[Label](destination Title)- URL auto linking
https://github.com/mlshv/tiny-markdown-parser
- URL auto linking
- Images:
)- linked:
[)](destination Title)
- linked:
- Lists:
- Unordered lists using:
+and- - Ordered lists using:
1. - Nested lists
- Unordered lists using:
- Tables:
| some | text |- Header row:
|- header -|- row -|or by a following|---
- Header row:
Special thanks
This project is a fork of micro-down by Dustin Hagemeier