Skip to content

Latest commit

 

History

History
57 lines (38 loc) · 1.55 KB

README.md

File metadata and controls

57 lines (38 loc) · 1.55 KB

Pinching hand emoji

npm bundle size

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