File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
sphinx/themes/basic/static Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -164,11 +164,11 @@ const Search = {
164164 const htmlElement = new DOMParser ( ) . parseFromString ( htmlString , 'text/html' ) ;
165165 htmlElement . querySelectorAll ( ".headerlink" ) . forEach ( ( el ) => { el . remove ( ) } ) ;
166166 if ( anchor ) {
167- const anchorContent = htmlElement . querySelector ( anchor ) ;
167+ const anchorContent = htmlElement . querySelector ( `[role="main"] ${ anchor } ` ) ;
168168 if ( anchorContent ) return anchorContent . textContent ;
169169
170170 console . warn (
171- `Anchor block not found. Sphinx search tries to obtain it via ' ${ anchor } '. Check your theme or template.`
171+ `Anchored content block not found. Sphinx search tries to obtain it via DOM query '[role=main] ${ anchor } '. Check your theme or template.`
172172 ) ;
173173 }
174174
@@ -177,7 +177,7 @@ const Search = {
177177 if ( docContent ) return docContent . textContent ;
178178
179179 console . warn (
180- "Content block not found. Sphinx search tries to obtain it via '[role=main]'. Could you check your theme or template."
180+ "Content block not found. Sphinx search tries to obtain it via DOM query '[role=main]'. Check your theme or template."
181181 ) ;
182182 return "" ;
183183 } ,
You can’t perform that action at this time.
0 commit comments