Skip to content

Commit ef53dec

Browse files
committed
Fix #9456: html search: html_copy_source can't control the search summaries
This reverts commit 634b05f. So far, users can disable showing summary texts via `html_copy_source` setting. But this change always show them forcedly. To keep compatibility, it should be reverted temporarily. refs: #9456
1 parent 9218ad4 commit ef53dec

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
@@ -23,6 +23,7 @@ Bugs fixed
2323
with the HEAD of 3.10
2424
* #9490: autodoc: Some objects under ``typing`` module are not displayed well
2525
with the HEAD of 3.10
26+
* #9456: html search: html_copy_source can't control the search summaries
2627
* #9435: linkcheck: Failed to check anchors in github.com
2728

2829
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)