mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #7194 from tk0miya/search_show_warning
html search: show warning if [role=main] element not found
This commit is contained in:
commit
723c4491c7
@ -64,7 +64,9 @@ var Search = {
|
||||
$(htmlElement).find('.headerlink').remove();
|
||||
docContent = $(htmlElement).find('[role=main]')[0];
|
||||
if(docContent === undefined) {
|
||||
return "";
|
||||
console.warn("Content block not found. Sphinx search tries to obtain it " +
|
||||
"via '[role=main]'. Could you check your theme or template.");
|
||||
return "";
|
||||
}
|
||||
return docContent.textContent || docContent.innerText;
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user