bit-docs-html-toc
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -64,2 +64,11 @@ module.exports = function makeTree(elements) { | ||
// Get elements without [data-skip] attribute only | ||
elements = elements.filter(function(element) { | ||
// check if element has attributes (for testing) | ||
if (element.attributes) { | ||
return !element.attributes['data-skip']; | ||
} | ||
return true; | ||
}); | ||
return map.call(elements, function(element) { | ||
@@ -66,0 +75,0 @@ var text = element.textContent; |
{ | ||
"name": "bit-docs-html-toc", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "table of contents bit-docs plugin", | ||
@@ -41,4 +41,4 @@ "main": "toc.js", | ||
"steal-mocha": "0.0.3", | ||
"testee": "^0.3.0-pre.2" | ||
"testee": "^0.9.1" | ||
} | ||
} |
@@ -59,2 +59,14 @@ var makeTree = require("../make-tree"); | ||
}); | ||
it("allows ignoring elements with data-skip attribute", function() { | ||
var elements = [ | ||
{ tagName: "h2", textContent: "new MyType", attributes: {} }, | ||
{ tagName: "h3", textContent: "Parameters", attributes: { 'data-skip': {} } }, | ||
{ tagName: "h2", textContent: "Configure", attributes: {} } | ||
]; | ||
assert.deepEqual(makeTree(elements), [ | ||
{id: "new-mytype", level: 2, text: "new MyType", children: []}, | ||
{ id: "configure", level: 2, text: "Configure", children: [] } | ||
]); | ||
}); | ||
}); |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
28331
709
1