Mark active sections even when their headings are in wrapper elements

This partially reverts 94c7f31082.
Headings inside wrapper divs etc. actually are rendered in the table
of contents.

Bug: T318044
Bug: T324869
Change-Id: Ie3181d9e9605cd2b5897b12931572057e80d6661
(cherry picked from commit f6c85143c6)
This commit is contained in:
Bartosz Dziewoński 2022-12-13 23:11:32 +01:00
parent e7cd7df568
commit 24f65b0fa1

View file

@ -287,7 +287,7 @@ const main = () => {
} );
const headingSelector = [
'h1', 'h2', 'h3', 'h4', 'h5', 'h6'
].map( ( tag ) => `.mw-parser-output > ${tag}` ).join( ',' );
].map( ( tag ) => `.mw-parser-output ${tag}` ).join( ',' );
const sectionObserver = initSectionObserver( {
elements: bodyContent.querySelectorAll( `${headingSelector}, .mw-body-content` ),
topMargin: header ? header.getBoundingClientRect().height : 0,