mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
searchtools: Use the correct check for docContent (#11885)
Co-authored-by: Konstantin Knuetel <konstantin.knuetel@pdfforge.org>
This commit is contained in:
parent
360c7a8022
commit
7041f11fb0
@ -164,7 +164,7 @@ const Search = {
|
||||
const htmlElement = new DOMParser().parseFromString(htmlString, 'text/html');
|
||||
htmlElement.querySelectorAll(".headerlink").forEach((el) => { el.remove() });
|
||||
const docContent = htmlElement.querySelector('[role="main"]');
|
||||
if (docContent !== undefined) return docContent.textContent;
|
||||
if (docContent) return docContent.textContent;
|
||||
console.warn(
|
||||
"Content block not found. Sphinx search tries to obtain it via '[role=main]'. Could you check your theme or template."
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user