|
@ -64,7 +64,7 @@ var md = require('markdown-it')(); |
|
|
var result = md.render('# markdown-it rulezz!'); |
|
|
var result = md.render('# markdown-it rulezz!'); |
|
|
|
|
|
|
|
|
// browser without AMD, added to "window" on script load |
|
|
// browser without AMD, added to "window" on script load |
|
|
// Note, there are no dash. |
|
|
// Note, there is no dash in "markdownit". |
|
|
var md = window.markdownit(); |
|
|
var md = window.markdownit(); |
|
|
var result = md.render('# markdown-it rulezz!'); |
|
|
var result = md.render('# markdown-it rulezz!'); |
|
|
``` |
|
|
``` |
|
@ -79,7 +79,7 @@ var result = md.renderInline('__markdown-it__ rulezz!'); |
|
|
|
|
|
|
|
|
### Init with presets and options |
|
|
### Init with presets and options |
|
|
|
|
|
|
|
|
(*) preset define combination of active rules and options. Can be |
|
|
(*) presets define combinations of active rules and options. Can be |
|
|
`"commonmark"`, `"zero"` or `"default"` (if skipped). See |
|
|
`"commonmark"`, `"zero"` or `"default"` (if skipped). See |
|
|
[API docs](https://markdown-it.github.io/markdown-it/#MarkdownIt.new) for more details. |
|
|
[API docs](https://markdown-it.github.io/markdown-it/#MarkdownIt.new) for more details. |
|
|
|
|
|
|
|
@ -188,7 +188,7 @@ Via plugins: |
|
|
### Manage rules |
|
|
### Manage rules |
|
|
|
|
|
|
|
|
By default all rules are enabled, but can be restricted by options. On plugin |
|
|
By default all rules are enabled, but can be restricted by options. On plugin |
|
|
load all it's rules are enabled automatically. |
|
|
load all its rules are enabled automatically. |
|
|
|
|
|
|
|
|
```js |
|
|
```js |
|
|
// Activate/deactivate rules, with curring |
|
|
// Activate/deactivate rules, with curring |
|
@ -208,7 +208,7 @@ md = require('markdown-it')('full', { |
|
|
|
|
|
|
|
|
## Benchmark |
|
|
## Benchmark |
|
|
|
|
|
|
|
|
Here is result of readme parse at MB Pro Retina 2013 (2.4 GHz): |
|
|
Here is the result of readme parse at MB Pro Retina 2013 (2.4 GHz): |
|
|
|
|
|
|
|
|
```bash |
|
|
```bash |
|
|
$ benchmark/benchmark.js readme |
|
|
$ benchmark/benchmark.js readme |
|
@ -226,7 +226,7 @@ __Note.__ CommonMark version runs with [simplified link normalizers](https://git |
|
|
for more "honest" compare. Difference is ~ 1.5x. |
|
|
for more "honest" compare. Difference is ~ 1.5x. |
|
|
|
|
|
|
|
|
As you can see, `markdown-it` doesn't pay with speed for it's flexibility. |
|
|
As you can see, `markdown-it` doesn't pay with speed for it's flexibility. |
|
|
Slowdown of "full" version caused by additional features, not available in |
|
|
Slowdown of "full" version caused by additional features not available in |
|
|
other implementations. |
|
|
other implementations. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|