cmark

My personal build of CMark ✏️

Commit
6b8f1433347557076140afb35ef4d9f036a658f9
Parent
996a96c1972697e320a958c0d6bf43e677398f01
Author
John MacFarlane <jgm@berkeley.edu>
Date

js/bench.js: use npm, added markdown-it.

Diffstat

1 file changed, 11 insertions, 4 deletions

Status File Name N° Changes Insertions Deletions
Modified js/bench.js 15 11 4
diff --git a/js/bench.js b/js/bench.js
@@ -2,10 +2,12 @@ var Benchmark = require('benchmark').Benchmark;
 var suite = new Benchmark.Suite();
 var fs = require('fs');
 var sm = require('./lib/index.js');
-// https://github.com/coreyti/showdown
-var showdown = require('../../showdown/src/showdown');
-// https://github.com/chjj/marked
-var marked = require('../../marked/marked.min.js');
+// npm install showdown
+var showdown = require('showdown');
+// npm install marked
+var marked = require('marked');
+// npm install markdown-it
+var markdownit = require('markdown-it')('commonmark');
 
 var benchfile = process.argv[2];
 
@@ -29,6 +31,11 @@ suite.add('commonmark.js markdown->html', function() {
   marked(contents);
 })
 
+.add('markdown-it markdown->html', function() {
+  "use strict";
+  markdownit.render(contents);
+})
+
 .on('cycle', function(event) {
   "use strict";
   console.log(String(event.target));