From 87498767642e0ad094788d926bb8573feb2fc38b Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Mon, 7 Sep 2015 16:43:32 +0200 Subject: [PATCH] Add support for changes in mdast-slug ...but the old one is still supported. --- index.js | 7 ++++++- package.json | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index f896675..bec45e4 100644 --- a/index.js +++ b/index.js @@ -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; diff --git a/package.json b/package.json index a04466a..384b35d 100644 --- a/package.json +++ b/package.json @@ -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",