A fork of md.js specifically for use with Feather Wiki
- JavaScript 98.1%
- HTML 1.9%
|
|
||
|---|---|---|
| examples | handle XSS edge case | |
| tests | v0.2.6 | |
| .gitattributes | init | |
| .gitignore | init | |
| .npmignore | init | |
| CHANGELOG.md | v0.2.6 | |
| LICENSE.md | init | |
| md.js | v0.2.6 | |
| md.min.js | v0.2.6 | |
| package.json | v0.2.6 | |
| README.md | v0.2.6 | |
MD.js
- ~1kb minified+gzipped
- ~1.5kb minified
MD is a lightweight markdown parser with default support for langauge specific code blocks and XSS filtering, for example
// replace . with `
```javascript
var int = 0;
will output the following
```html
<pre><code class="language-javascript">
var int = 0;
</code></pre>
XSS attempt <script>alert(1);</script> will be converted to <script>alert(1)</script>
while <a href="javascript:alert('xss')"></a> will be converted to <a href="#javascript:alert('xss')"></a>
and <img onerror="alert(1)"> inline events will be remove and more.
Browser Support
- Edge
- IE 8+
- Chrome
- Firefox
- Safari
Installation
direct download
<script src=md.min.js></script>
CDN
<script src=https://unpkg.com/md.js@0.2.6/md.min.js></script>
npm
npm install md.js --save
Useage
md('# Heading...');