File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -98,15 +98,24 @@ function setupShortcuts(shortcutDepth = 2) {
9898
9999 shortcutDepth += 1 ; // to account for the page title
100100
101- // Build a class selector for each header type, and concatenate with commas
101+ /*
102+ * We have build selectors to find headers in different contexts.
103+ * i. direct children of .content-container (main structure)
104+ * i. headers within tabpanels (for tabbed content)
105+ */
102106 let classes = "" ;
107+
103108 for ( let i = 2 ; i <= shortcutDepth ; i ++ ) {
104109 if ( i != 2 ) {
105110 classes += "," ;
106111 }
107112 classes += " .content-container > h" + i ;
108113 }
109114
115+ for ( let i = 2 ; i <= shortcutDepth ; i ++ ) {
116+ classes += ", [role='tabpanel'] > h" + i ;
117+ }
118+
110119 const classElements = Array . from ( document . querySelectorAll ( classes ) ) ;
111120
112121 // Only proceed if we found headers (to avoid creating an empty shortcuts section)
You can’t perform that action at this time.
0 commit comments