Plugin for Showdown to prevent the use of arbitrary HTML and allow only the specific Markdown syntax.
npm install showdown-htmlescape


This plugin for Showdown prevents
the use of arbitrary HTML and allows only the specific Markdown syntax.
This is useful if you want to allow your users to format text using the Markdown
syntax but you do not want them to directly enter HTML.
bower install showdown-htmlescape
npm install showdown-htmlescape
You can also download the latest release zip or tarball and include the file dist/showdown-htmlescape.js directly in your project.
You have to include both Showdown and the Showdown HTML Escape extension in your
project:
``HTML`
After including the extension in your application, you just need to enable it
for your Showdown converter:
`JavaScript`
var converter = new showdown.Converter({extensions: ['htmlescape']});
`JavaScript`
var showdown = require('showdown'),
showdownHtmlEscape = require('showdown-htmlescape');
var converter = new showdown.Converter({ extensions: [showdownHtmlEscape] });
`JavaScript`
var converter = new showdown.Converter({extensions: ['htmlescape']}),
input = 'Allows Markdown markup, but does not allow HTML markup',
html = converter.makeHtml(input);
console.log(html);
This should output:
` Allows Markdown markup, but does not allow <b>HTML markup</b>HTML``
Published under the MIT license, see LICENSE.txt for details.