markdown-like

1.1.1 • Public • Published

markdown-like

Yes, simple markdown-like things (also, escaping special HTML characters)

Text replacements:

*bold* <b>bold</b>

_italic_ <i>italic</i>

~strikethrough~ <s>strikethrough</s>

`monospace` <span class="monospace">monospace</span>

super^script^ super<sup>script</sup>

<td>sub|script|</td> <td>sub<sub>script</sub></td>

[link](http://aritzcracker.ca) <a href="http://aritzcracker.ca">link</a>

[@new tab link](http://aritzcracker.ca) <a href="http://aritzcracker.ca" target="_blank">new tab link</a>

escaping\_special\_characters\* escaping_special_characters*

Usage

const {markdownToHTML, escapeHTMLSpecialChars} = require("markdown-like")
console.log(escapeHTMLSpecialChars("Hello, *<world!>*")); // Hello, *&lt;world!&gt;*
console.log(markdownToHTML("Hello, *<world!>*")); // Hello, <b>&lt;world!&gt;</b>
console.log(markdownToHTML("Hello,\n_world!_")); // Hello, <i>world!</i>
console.log(markdownToHTML("Hello,\n_world!_", "<br>")); // Hello,<br><i>world!</i>

Readme

Keywords

none

Package Sidebar

Install

npm i markdown-like

Weekly Downloads

0

Version

1.1.1

License

MIT

Unpacked Size

7.06 kB

Total Files

4

Last publish

Collaborators

  • aritz-cracker