@shelf/table-of-contents 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,7 +12,7 @@ export const getDataWithoutNestedAnchors = (data, headerTemplate) => {
12
12
  }
13
13
  const doc = parser.parseFromString(results, 'text/xml');
14
14
  // get Toc pointer anchor node
15
- const firstAnchorElement = doc.querySelector(`a[href="#${data.anchor}"]`);
15
+ const firstAnchorElement = doc.querySelector(`a[href="#${data.anchor}"]:not(:empty)`);
16
16
  // get all content nodes from Toc pointer anchor node
17
17
  const contentArray = Array.from(firstAnchorElement?.childNodes ?? []);
18
18
  const parentNode = firstAnchorElement?.parentElement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shelf/table-of-contents",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Fork of node-toc to reduce bundle size & rewritten in TypeScript",
5
5
  "license": "MIT",
6
6
  "author": {