mdast-util-toc
Advanced tools
Comparing version 0.1.0 to 1.0.1
@@ -13,2 +13,4 @@ /** | ||
/* Dependencies */ | ||
var remark = require('remark'); | ||
var slug = require('remark-slug'); | ||
var toExpression = require('./to-expression'); | ||
@@ -31,9 +33,14 @@ var search = require('./search'); | ||
var result = search(node, heading, depth); | ||
var processor = remark().use(slug); | ||
var tree = processor.run(node); | ||
var result = search(tree, heading, depth); | ||
if (result.index === null || !result.map.length) { | ||
return []; | ||
return result; | ||
} | ||
return [contents(result.map, tight)]; | ||
return { | ||
map: [contents(result.map, tight)], | ||
index: result.index | ||
}; | ||
} |
{ | ||
"name": "mdast-util-toc", | ||
"version": "0.1.0", | ||
"version": "1.0.1", | ||
"description": "Generate a Table of Contents (TOC) from a given Markdown file", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
13016
375
1