@salesforcedevs/docs-components 1.3.9-h2-toc-fix-3 → 1.3.9-h2-toc-fix-4

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",
3
+ "version": "1.3.9-h2-toc-fix-4",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -192,9 +192,9 @@ export default class ContentLayout extends LightningElement {
192
192
  this.observer = new IntersectionObserver((entries) => {
193
193
  entries.forEach(
194
194
  (entry) =>
195
- (this.anchoredElements[
196
- entry.target.getAttribute("id")
197
- ].intersect = entry.isIntersecting)
195
+ (this.anchoredElements[
196
+ entry.target.getAttribute("id")
197
+ ].intersect = entry.isIntersecting)
198
198
  );
199
199
  this.calculateActualSection();
200
200
  });
@@ -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.attributes["aria-level"]?.nodeValue === "2";
247
+ const headingAriaLevel = headingElement.attributes["aria-level"]?.nodeValue || "2"
248
+ const isH2 = headingAriaLevel === "2";
249
249
 
250
250
  if (isH2) {
251
251
  const tocItem = {