mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-06-02 16:04:07 +03:00
Replaces markdown.js with [remarkable](https://github.com/jonschlinkert/remarkable).
- remarkable has 100% support for [commonmark](http://jgm.github.io/CommonMark/spec.html) - [faster](https://github.com/jonschlinkert/remarkable/tree/master/benchmark) - easier to monkeypatch. this is a goal of ours, might be useful to you at some point given the custom tokenizing/parsing you're doing for documentation.
This commit is contained in:
@@ -6,11 +6,13 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
var markdown = require('markdown').markdown;
|
||||
var Remarkable = require('remarkable');
|
||||
|
||||
function markdown2html(markdownString) {
|
||||
var md = new Remarkable();
|
||||
|
||||
// the slice removes the <p>...</p> wrapper output by Markdown processor
|
||||
return markdown.toHTML(markdownString.trim()).slice(3, -4);
|
||||
return md.render(markdownString.trim()).slice(3, -5);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user