Skip to content

Commit 8749876

Browse files
committed
Add support for changes in mdast-slug
...but the old one is still supported.
1 parent e9b32d4 commit 8749876

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,12 @@ function gatherExposedFactory() {
310310
cache[filePath] = true;
311311

312312
visit(ast, 'heading', function (node) {
313-
var id = node.attributes && node.attributes.id;
313+
var data = node.data || {};
314+
var attributes = data.htmlAttributes || {};
315+
var id = attributes.id || data.id;
316+
317+
/* istanbul ignore next */
318+
id = id || (node.attributes && node.attributes.id);
314319

315320
hasHeadings = true;
316321

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
],
1414
"dependencies": {
1515
"github-url-to-object": "^1.5.2",
16-
"mdast-slug": "^1.0.0",
16+
"mdast-slug": "^2.0.0",
1717
"mdast-util-definitions": "^1.0.0",
1818
"unist-util-visit": "^1.0.0",
1919
"propose": "0.0.5",

0 commit comments

Comments
 (0)