Skip to content

Commit

Permalink
Update for remark@7.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Feb 23, 2017
1 parent 86b5527 commit 4dc73c7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
10 changes: 6 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ completer.pluginId = 'remark-validate-links';
var exists = fs.existsSync;
var parse = url.parse;

function attacher(remark, options, fileSet) {
function attacher(options, fileSet) {
var repo = (options || {}).repository;
var pack;

Expand Down Expand Up @@ -47,10 +47,12 @@ function attacher(remark, options, fileSet) {
fileSet.use(completer);

/* Attach `slug`. */
remark.use(slug);
this.use(slug).use(subplugin);

/* Expose transformer. */
return transformerFactory({user: repo.user, repo: repo.repo}, fileSet);
function subplugin() {
/* Expose transformer. */
return transformerFactory({user: repo.user, repo: repo.repo}, fileSet);
}
}

/* Completer. */
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@
"devDependencies": {
"execa": "^0.6.0",
"nyc": "^10.0.0",
"remark": "^6.0.0",
"remark-cli": "^2.0.0",
"remark": "^7.0.0",
"remark-cli": "^3.0.0",
"remark-preset-wooorm": "^1.0.0",
"strip-ansi": "^3.0.1",
"tape": "^4.0.0",
"xo": "^0.17.1"
},
"scripts": {
"build-md": "remark *.md --quiet --frail",
"build-md": "# remark *.md --quiet --frail",
"build": "npm run build-md",
"lint": "xo",
"test-api": "node test/index.js",
Expand Down
2 changes: 1 addition & 1 deletion test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ test('remark-validate-links', function (t) {

t.throws(
function () {
remark().use(links);
remark().use(links).freeze();
},
/Error: remark-validate-links only works on the CLI/,
'should throw an error when not on the CLI'
Expand Down

0 comments on commit 4dc73c7

Please sign in to comment.