Skip to content
This repository has been archived by the owner on Dec 18, 2024. It is now read-only.

Commit

Permalink
docs-bug(Theming Angular Material): table of contents misses h2 headers
Browse files Browse the repository at this point in the history
Fixed issue of h2 titles not being displayed in the table of contents

Fixes #29071
  • Loading branch information
HermanWKeuris authored and crisbeto committed Aug 28, 2024
1 parent ede6fb7 commit f86578b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/shared/table-of-contents/table-of-contents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export class TableOfContents implements OnInit, AfterViewInit, OnDestroy {
}

addHeaders(sectionName: string, docViewerContent: HTMLElement, sectionIndex = 0) {
const links = Array.from(docViewerContent.querySelectorAll('h3, h4'), header => {
const links = Array.from(docViewerContent.querySelectorAll('h2, h3, h4'), header => {
// remove the 'link' icon name from the inner text
const name = (header as HTMLElement).innerText.trim().replace(/^link/, '');
const {top} = header.getBoundingClientRect();
Expand Down

0 comments on commit f86578b

Please sign in to comment.