Fix #3183: Randomized jump box order in generated index page.

This commit is contained in:
shimizukawa 2016-12-13 00:47:18 +09:00
parent 5fc8d3db91
commit 4054b0b3a5
2 changed files with 6 additions and 2 deletions

View File

@ -23,7 +23,7 @@ Bugs fixed
* #3228: ``build_sphinx`` command crashes when missing dependency
* #2469: Ignore updates of catalog files for gettext builder. Thanks to
Hiroshi Ohkubo.
* #3183: Randomized jump box order in generated index page.
Release 1.5 (released Dec 5, 2016)
==================================

View File

@ -115,7 +115,11 @@ class IndexEntries(EnvironmentManager):
# sort the index entries; put all symbols at the front, even those
# following the letters in ASCII, this is where the chr(127) comes from
def keyfunc(entry, lcletters=string.ascii_lowercase + '_'):
lckey = unicodedata.normalize('NFD', entry[0].lower())
key, (void, void, category_key) = entry
if category_key:
# using specified category key to sort
key = category_key
lckey = unicodedata.normalize('NFD', key.lower())
if lckey[0:1] in lcletters:
lckey = chr(127) + lckey
# ensure a determinstic order *within* letters by also sorting on