Skip to content

Commit ef680d1

Browse files
authored
Merge pull request #6804 from readthedocs/fix-search-sphinx-2.1
Make search compatible with sphinx 2.2.1
2 parents aac8fb3 + 61807e9 commit ef680d1

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

readthedocs/core/static-src/core/js/doc-embed/search.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,13 @@ function attach_elastic_search_query(data) {
7777
}
7878

7979
// Creating the result from elements
80-
var link = doc.link + DOCUMENTATION_OPTIONS.FILE_SUFFIX;
80+
var suffix = DOCUMENTATION_OPTIONS.FILE_SUFFIX;
81+
// Since sphinx 2.2.1 FILE_SUFFIX is .html for all builders,
82+
// and there is a new BUILDER option.
83+
if ('BUILDER' in DOCUMENTATION_OPTIONS && DOCUMENTATION_OPTIONS.BUILDER === 'readthedocsdirhtml') {
84+
suffix = '';
85+
}
86+
var link = doc.link + suffix;
8187

8288
var item = $('<a>', {'href': link});
8389

0 commit comments

Comments
 (0)