All Projects → phw → Showdown Htmlescape

phw / Showdown Htmlescape

Licence: mit
Plugin for Showdown to prevent the use of arbitrary HTML and allow only the specific Markdown syntax.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Showdown Htmlescape

Multiple Dates Picker For Jquery Ui
MDP is a little plugin that enables jQuery UI calendar to manage multiple dates.
Stars: ✭ 256 (+4166.67%)
Mutual labels:  npm, bower
Bootstrap Iconpicker
A simple icon picker
Stars: ✭ 344 (+5633.33%)
Mutual labels:  npm, bower
Flow Netbeans Markdown
Markdown file support for the NetBeans IDE
Stars: ✭ 276 (+4500%)
Mutual labels:  markdown, plugin
Honkit
📖 HonKit is building beautiful books using Markdown - Fork of GitBook
Stars: ✭ 1,901 (+31583.33%)
Mutual labels:  markdown, plugin
Bower Material
This repository is used for publishing the AngularJS Material v1.x library
Stars: ✭ 510 (+8400%)
Mutual labels:  npm, bower
Sonar Cnes Report
Generates analysis reports from SonarQube web API.
Stars: ✭ 145 (+2316.67%)
Mutual labels:  markdown, plugin
Vimpyter
Edit your Jupyter notebooks in Vim/Neovim
Stars: ✭ 308 (+5033.33%)
Mutual labels:  markdown, plugin
Docsify Tabs
A docsify.js plugin for rendering tabbed content from markdown
Stars: ✭ 65 (+983.33%)
Mutual labels:  markdown, plugin
Npm Gui
Graphic tool for managing javascript project dependencies - in a friendly way.
Stars: ✭ 454 (+7466.67%)
Mutual labels:  npm, bower
Smartbanner.js
Customisable smart app banners for iOS and Android
Stars: ✭ 391 (+6416.67%)
Mutual labels:  npm, bower
Vim Gfm Syntax
GitHub Flavored Markdown syntax highlight extension for Vim
Stars: ✭ 91 (+1416.67%)
Mutual labels:  markdown, plugin
Simplestatemanager
A responsive state manager which allows you to run different javascript at different browser widths
Stars: ✭ 632 (+10433.33%)
Mutual labels:  npm, bower
Godot Engine.file Editor
A Godot Engine addon that adds a File Editor for multiple file types editing. Create and Write plain text files, configuration files and csv files with custom visualizers and previews. Also supports file translations!
Stars: ✭ 70 (+1066.67%)
Mutual labels:  markdown, plugin
Sublimetext Markdown Preview
markdown preview and build plugin for sublime text 2/3
Stars: ✭ 2,337 (+38850%)
Mutual labels:  markdown, plugin
Markdown Builder
1kb Markdown builder for Node.js
Stars: ✭ 67 (+1016.67%)
Mutual labels:  markdown, npm
Arcgis Js Api
Minified version of the ArcGIS API for JavaScript
Stars: ✭ 290 (+4733.33%)
Mutual labels:  npm, bower
Marked
Confluence macro plugin which renders remote Markdown.
Stars: ✭ 42 (+600%)
Mutual labels:  markdown, plugin
React Native Markdown Editor
A markdown editor like github comment editor (contains preview, helper buttons)
Stars: ✭ 59 (+883.33%)
Mutual labels:  markdown, npm
Editormd
Markdown 编辑器 Editor.md for Typecho
Stars: ✭ 389 (+6383.33%)
Mutual labels:  markdown, plugin
Inlineattachment
Easily paste and upload files/images in plain textareas
Stars: ✭ 597 (+9850%)
Mutual labels:  npm, bower

Showdown HTML Escape plugin

npm version Bower version Dependency Status devDependency Status

Build Status Code Climate Test Coverage

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.

Installation

With bower

bower install showdown-htmlescape

With npm

npm install showdown-htmlescape

Manual

You can also download the latest release zip or tarball and include the file dist/showdown-htmlescape.js directly in your project.

Enabling the extension

Browser

You have to include both Showdown and the Showdown HTML Escape extension in your project:

<script src="showdown.min.js"></script>
<script src="showdown-htmlescape.min.js"></script>

After including the extension in your application, you just need to enable it for your Showdown converter:

var converter = new showdown.Converter({extensions: ['htmlescape']})

Node.js

var showdown = require('showdown')
var showdownHtmlEscape = require('showdown-htmlescape')
var converter = new showdown.Converter({ extensions: [showdownHtmlEscape] })

Usage example

var converter = new showdown.Converter({extensions: ['htmlescape']})
var input = 'Allows **Markdown markup**, but does not allow <b>HTML markup</b>'
var html = converter.makeHtml(input)
console.log(html)

This should output:

<p>Allows <strong>Markdown markup</strong>, but does not allow &lt;b&gt;HTML markup&lt;/b&gt;</p>

Notes on security

This plugin is not meant to protect you from XSS attacks, it justs limits the syntax available to the user to the Markdown specific syntax. If security and XSS prevention is important for your use case you still must filter the HTML generated by Showdown. See Markdown's XSS Vulnerability (and how to mitigate it) for details.

License

Showdown HTML Escape Copyright © 2015-2016 Philipp Wolfer [email protected]

Published under the MIT license, see LICENSE.txt for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].