Skip to content

Commit 7041f11

Browse files
kkntlKonstantin Knuetel
andauthored
searchtools: Use the correct check for docContent (#11885)
Co-authored-by: Konstantin Knuetel <[email protected]>
1 parent 360c7a8 commit 7041f11

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sphinx/themes/basic/static/searchtools.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ const Search = {
164164
const htmlElement = new DOMParser().parseFromString(htmlString, 'text/html');
165165
htmlElement.querySelectorAll(".headerlink").forEach((el) => { el.remove() });
166166
const docContent = htmlElement.querySelector('[role="main"]');
167-
if (docContent !== undefined) return docContent.textContent;
167+
if (docContent) return docContent.textContent;
168168
console.warn(
169169
"Content block not found. Sphinx search tries to obtain it via '[role=main]'. Could you check your theme or template."
170170
);

0 commit comments

Comments
 (0)