Javascript library that helps you convert simplified markdown (like used in Slack messages) to HTML
You can download the latest release tarball directly from [releases][releases]
bower install light-markdown
npm install light-markdown
You can also use one of several CDNs available:
-
github CDN
https://cdn.rawgit.com/Tonkean/lightMarkdown/<version tag>/dist/light-markdown.min.js
var light-markdown = require('light-markdown');
var text = 'This should be *bold*';
var html = light-markdown.toHtml(text);
var text = 'This should be *bold*';
var html = light-markdown.toHtml(text);
Both examples should output...
<p>This should be <b>bold</b></p>
A suite of tests is available which require node.js. Once node is installed, run the following command from the project root to install the dependencies:
npm install
Once installed the tests can be run from the project root using:
npm test
New test cases can easily be added. Create a light markdown file (ending in .lmd
) which contains the markdown to test. Create a .html
file of the exact same name. It will automatically be tested when the tests are executed with mocha
.