mirror of
https://github.com/danbulant/markdown-wasm
synced 2026-07-06 03:30:40 +00:00
add remarkable benchmark
This commit is contained in:
parent
0d99d1151f
commit
41cf2dc97c
2 changed files with 8 additions and 0 deletions
|
|
@ -6,6 +6,7 @@ const Path = require('path')
|
||||||
const commonmark = require('commonmark')
|
const commonmark = require('commonmark')
|
||||||
const Showdown = require('showdown')
|
const Showdown = require('showdown')
|
||||||
const marked = require('marked')
|
const marked = require('marked')
|
||||||
|
const { Remarkable } = require('remarkable');
|
||||||
const markdownit = require('markdown-it')('commonmark')
|
const markdownit = require('markdown-it')('commonmark')
|
||||||
const markdown_wasm = require('../../dist/markdown.node.js')
|
const markdown_wasm = require('../../dist/markdown.node.js')
|
||||||
|
|
||||||
|
|
@ -22,6 +23,9 @@ var showdown = new Showdown.Converter()
|
||||||
var parser = new commonmark.Parser()
|
var parser = new commonmark.Parser()
|
||||||
var renderer = new commonmark.HtmlRenderer()
|
var renderer = new commonmark.HtmlRenderer()
|
||||||
|
|
||||||
|
// setup remarkable
|
||||||
|
var remarkable = new Remarkable();
|
||||||
|
|
||||||
// parse CLI input
|
// parse CLI input
|
||||||
let filename = process.argv[2]
|
let filename = process.argv[2]
|
||||||
if (!filename) {
|
if (!filename) {
|
||||||
|
|
@ -76,6 +80,9 @@ function benchmarkFile(benchfile) {
|
||||||
.add('marked', function() {
|
.add('marked', function() {
|
||||||
marked(contents);
|
marked(contents);
|
||||||
})
|
})
|
||||||
|
.add('remarkable', function() {
|
||||||
|
remarkable.render(contents);
|
||||||
|
})
|
||||||
.add('markdown-it', function() {
|
.add('markdown-it', function() {
|
||||||
markdownit.render(contents);
|
markdownit.render(contents);
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@
|
||||||
"d3-node": "^2.2.2",
|
"d3-node": "^2.2.2",
|
||||||
"markdown-it": "^10.0.0",
|
"markdown-it": "^10.0.0",
|
||||||
"marked": "^0.7.0",
|
"marked": "^0.7.0",
|
||||||
|
"remarkable": "^2.0.1",
|
||||||
"showdown": "^1.9.1",
|
"showdown": "^1.9.1",
|
||||||
"svgo": "^1.3.2"
|
"svgo": "^1.3.2"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue