1.0.5 • Published 1 year ago

dis.md v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

dis.md

A simple JavaScript library for parsing Discord markdown syntax and converting it to HTML.

Installation

You can install discord-md-parser using npm by running the following command:

npm install dis.md

Usage

To use the discord-md-parser library, you first need to import it into your JavaScript code:

const markdown = require('dis.md');

Then, you can use the parse function to convert Discord markdown syntax to HTML. For example:

const md = '**BEST SALES**, _LOL_, __LOL__, **LOL**, ~~LOL~~, `LOL`,\n```js\nconsole.log("Hello, world!");\n```';
const html = markdown.parse(md);
console.log(html); // logs the parsed HTML

This will output the following HTML:

<strong>BEST SALES</strong>, <em>LOL</em>, <u>LOL</u>, <strong>LOL</strong>, <s>LOL</s>, <span style="background-color: black; font-family: monospace; color: white;">LOL</span><br /><pre>console.log("Hello, world!");</pre>

PS: you should be able to use dis.md on the browser!

<script src="discord-md.js"></script>
<script>
// Call the function
const result = parse('**Hello world!**');
console.log(result);
</script>

Credits

Credits goes to abdlmutii, if you like this npm package please remember to check other work i've done on github and star this repo.

License

This library is licensed under the MIT License.