tiny-mark
v1.0.4
Published
A tiny partial markdown to html formatter
Downloads
3
Maintainers
Readme
tiny-mark
A tiny markdown to html formatter
Only a part of markdown is included. See formatting table below.
Install
Node
$ npm install tiny-mark
Browser
<script src="https://cdn.jsdelivr.net/npm/tiny-mark@1/dist/browser/tinymark.min.js"></script>
Exported as a global function
tinymark
Usage
import tinymark from "tiny-mark";
// or if you're using plain js
const tinymark = require("tiny-mark");
tinymark("*foo*");
// => "<b>foo</b>"
tinymark("_foo_");
// => "<em>foo</em>"
tinymark("_*foo*_");
// => "<em><b>foo</b></em>"
tinymark("*long _foo* bar_");
// => "<b>long <em>foo</em></b><em> bar</em>"
tinymark("*_foo_ \n bar*");
// => "<b><em>foo</em> <br /> bar</b>"
Formatting Table
| Syntax | Formatting | Status |
| --------------------------------------------- | ----------------- | -------------------------------- |
| *bold* | Bold (<b>
) | ✅ Added |
| _italic_ | Emphasis (<em>
) | ✅ Added |
| new\nline | Break (<br />
) | ✅ Added |
| [Google](https://google.com) | Link | 👀 Coming Soon |