Skip to content

Commit

Permalink
declare undeclared variables
Browse files Browse the repository at this point in the history
fix for markedjs/marked#990

git-svn-id: https://github.com/chjj/marked.git@805 de94abd1-4c94-9ff3-2ac9-ce57b7db7bff
  • Loading branch information
kara.leary committed Dec 27, 2017
1 parent e2e9723 commit b6d3cb6
Show file tree
Hide file tree
Showing 173 changed files with 4,359 additions and 203 deletions.
1 change: 0 additions & 1 deletion branches/release-0.3.11/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
node_modules/
test/compiled_tests
44 changes: 24 additions & 20 deletions branches/release-0.3.11/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,19 +321,23 @@ features][gfmf].

## Benchmarks

node v8.9.4
node v0.8.x

``` bash
$ npm run bench
marked completed in 3408ms.
marked (gfm) completed in 3465ms.
marked (pedantic) completed in 3032ms.
showdown (reuse converter) completed in 21444ms.
showdown (new converter) completed in 23058ms.
markdown-it completed in 3364ms.
markdown.js completed in 12090ms.
$ node test --bench
marked completed in 3411ms.
marked (gfm) completed in 3727ms.
marked (pedantic) completed in 3201ms.
robotskirt completed in 808ms.
showdown (reuse converter) completed in 11954ms.
showdown (new converter) completed in 17774ms.
markdown-js completed in 17191ms.
```

__Marked is now faster than Discount, which is written in C.__

For those feeling skeptical: These benchmarks run the entire markdown test suite 1000 times. The test suite tests every feature. It doesn't cater to specific aspects.

### Pro level

You also have direct access to the lexer and parser if you so desire.
Expand Down Expand Up @@ -368,23 +372,23 @@ suite. If you're adding a new feature, be sure to add your own test.
The marked test suite is set up slightly strangely: `test/new` is for all tests
that are not part of the original markdown.pl test suite (this is where your
test should go if you make one). `test/original` is only for the original
markdown.pl tests.
markdown.pl tests. `test/tests` houses both types of tests after they have been
combined and moved/generated by running `node test --fix` or `marked --test
--fix`.
In other words, if you have a test to add, add it to `test/new/`. If your test
In other words, if you have a test to add, add it to `test/new/` and then
regenerate the tests with `node test --fix`. Commit the result. If your test
uses a certain feature, for example, maybe it assumes GFM is *not* enabled, you
can add [front-matter](https://www.npmjs.com/package/front-matter) to the top of
your .md file
``` yml
---
gfm: false
---
```
can add `.nogfm` to the filename. So, `my-test.text` becomes
`my-test.nogfm.text`. You can do this with any marked option. Say you want
line breaks and smartypants enabled, your filename should be:
`my-test.breaks.smartypants.text`.
To run the tests:
``` bash
npm run test
cd marked/
node test
```
### Contribution and License Agreement
Expand Down
4 changes: 2 additions & 2 deletions branches/release-0.3.11/lib/marked.js
Original file line number Diff line number Diff line change
Expand Up @@ -1144,8 +1144,8 @@ function resolveUrl(base, href) {
return base + href;
}
}
baseUrls = {};
originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;
var baseUrls = {};
var originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;

function noop() {}
noop.exec = noop;
Expand Down
80 changes: 0 additions & 80 deletions branches/release-0.3.11/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions branches/release-0.3.11/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
"devDependencies": {
"markdown": "*",
"showdown": "*",
"markdown-it": "*",
"front-matter": "^2.3.0",
"gulp": "^3.8.11",
"gulp-uglify": "^1.1.0",
"gulp-concat": "^2.5.2"
Expand Down
Loading

0 comments on commit b6d3cb6

Please sign in to comment.