dis.md
v1.0.5
Published
Dis.md is a library to parse discord markdowns into html mark-up!
Downloads
17
Maintainers
Readme
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.mdUsage
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 HTMLThis 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.
