Comparing version 0.0.7 to 0.0.8
@@ -20,3 +20,3 @@ /** | ||
list: /^( *)([*+-]|\d+\.) [^\0]+?(?:\n{2,}(?! )|\s*$)(?!\1\2|\1\d+\.)/, | ||
html: /^(?:<!--[^\0]*?-->|<(\w+)[^\0]+?<\/\1>|<[^<>\n]+>) *(?:\n{2,}|\s*$)/, | ||
html: /^ *(?:<!--[^\0]*?-->|<(\w+)[^\0]+?<\/\1>|<[^<>\n]+>) *(?:\n{2,}|\s*$)/, | ||
text: /^[^\n]+/ | ||
@@ -23,0 +23,0 @@ }; |
@@ -5,3 +5,3 @@ { | ||
"author": "Christopher Jeffrey", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"main": "./lib/marked.js", | ||
@@ -8,0 +8,0 @@ "bin": { "marked": "./bin/marked" }, |
@@ -9,10 +9,16 @@ # marked | ||
``` bash | ||
$ node test --old_bench | ||
marked: 6260ms | ||
showdown: 21665ms | ||
markdownjs: 69168ms | ||
$ node test --bench | ||
marked completed in 15051ms. | ||
showdown completed in 28267ms. | ||
markdown-js completed in 70732ms. | ||
``` | ||
(Above is the old benchmark, try `node test --bench` for the new ones.) | ||
## Install | ||
``` bash | ||
$ npm install marked | ||
``` | ||
# Another javascript markdown parser | ||
The point of marked was to create a markdown compiler where it was possible to | ||
@@ -27,10 +33,8 @@ frequently parse huge chunks of markdown without having to worry about | ||
entirety. This is important because a surprising number of markdown compilers | ||
cannot pass more than a few tests. | ||
cannot pass more than a few tests. It was very difficult to get marked as | ||
compliant as it is. It could have cut corners in several areas for the sake | ||
of performance, but did not in order to be exactly what you expect in terms | ||
of a markdown rendering. In fact, this is why marked could be considered at a | ||
disadvantage in the benchmarks above. | ||
## Install | ||
``` bash | ||
$ npm install marked | ||
``` | ||
## Usage | ||
@@ -50,2 +54,11 @@ | ||
``` bash | ||
$ node | ||
> require('marked').lexer('> i am using marked.') | ||
[ { type: 'blockquote_start' }, | ||
{ type: 'text', text: ' i am using marked.' }, | ||
{ type: 'blockquote_end' }, | ||
links: {} ] | ||
``` | ||
## Todo (& notes to self) | ||
@@ -57,5 +70,3 @@ | ||
features while remaining backwardly compatible with all markdown syntax. | ||
- Optimize the parser so it accepts a stream of tokens from the lexer. This | ||
should enhance performance even further, although, no lookaheads would | ||
be possible. | ||
- Optimize the lexer to return an iterator instead of a collection of tokens. | ||
- Add an explicit pretty printing and minification feature. |
@@ -17,3 +17,2 @@ #!/usr/bin/env node | ||
.readdirSync(dir) | ||
//.concat('/../main.md') | ||
.filter(function(file) { | ||
@@ -20,0 +19,0 @@ return path.extname(file) !== '.html'; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
213248
69
814