Skip to content

Commit

Permalink
Add support for changes in mdast-slug
Browse files Browse the repository at this point in the history
...but the old one is still supported.
  • Loading branch information
wooorm committed Sep 7, 2015
1 parent e9b32d4 commit 8749876
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,12 @@ function gatherExposedFactory() {
cache[filePath] = true;

visit(ast, 'heading', function (node) {
var id = node.attributes && node.attributes.id;
var data = node.data || {};
var attributes = data.htmlAttributes || {};
var id = attributes.id || data.id;

/* istanbul ignore next */
id = id || (node.attributes && node.attributes.id);

hasHeadings = true;

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
],
"dependencies": {
"github-url-to-object": "^1.5.2",
"mdast-slug": "^1.0.0",
"mdast-slug": "^2.0.0",
"mdast-util-definitions": "^1.0.0",
"unist-util-visit": "^1.0.0",
"propose": "0.0.5",
Expand Down

0 comments on commit 8749876

Please sign in to comment.