Skip to content

Commit 4dc45f0

Browse files
authored
Merge pull request #9494 from tk0miya/9456_revert_9129
Fix #9456: html search: html_copy_source can't control the search summaries
2 parents 5d8f925 + df562b4 commit 4dc45f0

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CHANGES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Bugs fixed
2424
* #9490: autodoc: Some objects under ``typing`` module are not displayed well
2525
with the HEAD of 3.10
2626
* #9436, #9471: autodoc: crashed if ``autodoc_class_signature = "separated"``
27+
* #9456: html search: html_copy_source can't control the search summaries
2728
* #9435: linkcheck: Failed to check anchors in github.com
2829

2930
Testing

sphinx/themes/basic/static/searchtools.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ var Search = {
276276
setTimeout(function() {
277277
displayNextItem();
278278
}, 5);
279-
} else {
279+
} else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) {
280280
$.ajax({url: requestUrl,
281281
dataType: "text",
282282
complete: function(jqxhr, textstatus) {
@@ -289,6 +289,12 @@ var Search = {
289289
displayNextItem();
290290
}, 5);
291291
}});
292+
} else {
293+
// no source available, just display title
294+
Search.output.append(listItem);
295+
setTimeout(function() {
296+
displayNextItem();
297+
}, 5);
292298
}
293299
}
294300
// search finished, update title and status message

0 commit comments

Comments
 (0)