diff options
author | shimizukawa <shimizukawa@gmail.com> | 2016-12-13 00:47:18 +0900 |
---|---|---|
committer | shimizukawa <shimizukawa@gmail.com> | 2016-12-13 00:47:18 +0900 |
commit | 4054b0b3a554a0a08a39f5a6152a97c31f8ed13b (patch) | |
tree | 75f641ebf923fbdcf2e11f6f586dcbf2f1d68a68 /sphinx/environment/managers/indexentries.py | |
parent | 5fc8d3db9160cf9dcbb5ed1034aec9302dbac0dd (diff) | |
download | sphinx-git-4054b0b3a554a0a08a39f5a6152a97c31f8ed13b.tar.gz |
Fix #3183: Randomized jump box order in generated index page.
Diffstat (limited to 'sphinx/environment/managers/indexentries.py')
-rw-r--r-- | sphinx/environment/managers/indexentries.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sphinx/environment/managers/indexentries.py b/sphinx/environment/managers/indexentries.py index c35a161b4..d4e5f05bd 100644 --- a/sphinx/environment/managers/indexentries.py +++ b/sphinx/environment/managers/indexentries.py @@ -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 |