summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2011-01-04 19:23:47 +0100
committerGeorg Brandl <georg@python.org>2011-01-04 19:23:47 +0100
commitcdbd0db87d7d4bc23b9b42d67237f6706eac0cd9 (patch)
tree16e01fcbf6418b79e26a975d0feefa1bb5925ed0
parent7733526dca13e6cedf7642d798c86aaa8652d4c2 (diff)
downloadsphinx-cdbd0db87d7d4bc23b9b42d67237f6706eac0cd9.tar.gz
#148: Support sorting a limited range of accented characters in the glossary.
-rw-r--r--CHANGES4
-rw-r--r--sphinx/domains/std.py3
2 files changed, 4 insertions, 3 deletions
diff --git a/CHANGES b/CHANGES
index 2abc6795..96c131f5 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,8 +1,8 @@
Release 1.0.6 (in development)
==============================
-* #383: Support sorting a limited range of accented characters
- in the general index.
+* #383, #148: Support sorting a limited range of accented characters
+ in the general index and the glossary.
* #570: Try decoding ``-D`` and ``-A`` command-line arguments with
the locale's preferred encoding.
diff --git a/sphinx/domains/std.py b/sphinx/domains/std.py
index 0609388e..0625a451 100644
--- a/sphinx/domains/std.py
+++ b/sphinx/domains/std.py
@@ -10,6 +10,7 @@
"""
import re
+import unicodedata
from docutils import nodes
from docutils.parsers.rst import directives
@@ -250,7 +251,7 @@ class Glossary(Directive):
li.insert(0, indexnode)
items.append((termtext, li))
if 'sorted' in self.options:
- items.sort(key=lambda x: x[0].lower())
+ items.sort(key=lambda x: unicodedata.normalize('NFD', x[0].lower()))
new_dl.extend(item[1] for item in items)
node.children = [new_dl]
return [node]