@@ -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