Make searchtools.js support old searchindex.js files

Sphinx 4.3 has changed format of searchindex.js files, but in Debian
there are lots of packages built with older Sphinx, and we want to
keep them working for some time.

Forwarded: not-needed

Gbp-Pq: Name support_old_search_indexes.diff
This commit is contained in:
Dmitry Shachnev 2021-12-11 19:19:27 +03:00 committed by openKylinBot
parent f0e8f8ab62
commit bd3017c63b
1 changed files with 3 additions and 0 deletions

View File

@ -328,6 +328,9 @@ var Search = {
var results = [];
for (var prefix in objects) {
if (!(objects[prefix] instanceof Array)) {
objects[prefix] = Object.entries(objects[prefix]).map(([name, match]) => [...match, name]);
}
for (var iMatch = 0; iMatch != objects[prefix].length; ++iMatch) {
var match = objects[prefix][iMatch];
var name = match[4];