@salesforcedevs/docs-components 1.3.9-h2-toc-fix → 1.3.9-h2-toc-fix-2

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/docs-components",
3
- "version": "1.3.9-h2-toc-fix",
3
+ "version": "1.3.9-h2-toc-fix-2",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -244,8 +244,8 @@ export default class ContentLayout extends LightningElement {
244
244
  headingElement.id = headingElement.hash;
245
245
 
246
246
  // Update tocOptions from anchorTags only for H2
247
- const isH2 =
248
- headingElement?.shadowRoot?.querySelectorAll("h2").length;
247
+ const isH2 = headingElement.attributes["aria-level"]?.nodeValue === "2"
248
+
249
249
  if (isH2) {
250
250
  const tocItem = {
251
251
  anchor: `#${headingElement.hash}`,