Quickstart
To quickstart with Showdown, install it as a package (for server-side) or include it to your browser (client-side) via CDN:
Installation
Server-side
npm install showdown
bower install showdown
PM> Install-Package showdownjs
More information about the package you can find on the NuGet website.
Client-side
https://cdn.jsdelivr.net/npm/showdown@<version>/dist/showdown.min.js
https://cdnjs.cloudflare.com/ajax/libs/showdown/<version>/showdown.min.js
https://unpkg.com/showdown/dist/showdown.min.js
Replace <version>
with an actual full length version you're interested in. For example, 2.0.3
.
Usage
Once installed, you can use Showndown according to the chosen method:
Server-side
Node.js
var showdown = require('showdown'),
converter = new showdown.Converter(),
text = '# hello, markdown!',
html = converter.makeHtml(text);
<h1 id="hellomarkdown">hello, markdown!</h1>
Client-side
Browser
var converter = new showdown.Converter(),
text = '# hello, markdown!',
html = converter.makeHtml(text);
<h1 id="hellomarkdown">hello, markdown!</h1>
Potential XSS vulnerabilities
Showdown doesn't sanitize the input since Markdown relies on it to parse certain features correctly into HTML. As a result, this may lead to potential XSS injection vulnerabilities.
Please refer to the Markdown's XSS vulnerability page for more information.
Other installation methods
Tarball
You can download the latest tarball directly from releases.
Previous versions
If you're looking for Showdown prior to version 1.0.0, you can find them in the legacy branch.
Changelog
The full changelog is available here.