diff options
author | Georg Brandl <georg@python.org> | 2012-01-29 11:36:12 +0100 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2012-01-29 11:36:12 +0100 |
commit | b0fa4acb45d871e2a1778c1e961c1bffe8367981 (patch) | |
tree | 69eb06078c8e261dbef0528ed56b3990515a8b29 | |
parent | d86a3a3e2f4ed37d5170617c8f6ef2a4a4508cea (diff) | |
download | sphinx-b0fa4acb45d871e2a1778c1e961c1bffe8367981.tar.gz |
Closes #832: Fix crashes when putting comments or lone terms in a glossary.
-rw-r--r-- | CHANGES | 2 | ||||
-rw-r--r-- | sphinx/domains/std.py | 6 |
2 files changed, 7 insertions, 1 deletions
@@ -33,6 +33,8 @@ Release 1.1.3 (in development) * #854: Fix inheritance_diagram raising attribute errors on builtins. +* #832: Fix crashes when putting comments or lone terms in a glossary. + Release 1.1.2 (Nov 1, 2011) -- 1.1.1 is a silly version number anyway! ====================================================================== diff --git a/sphinx/domains/std.py b/sphinx/domains/std.py index 1c68c449..05672b98 100644 --- a/sphinx/domains/std.py +++ b/sphinx/domains/std.py @@ -245,6 +245,9 @@ class Glossary(Directive): continue # unindented line -> a term if line and not line[0].isspace(): + # enable comments + if line.startswith('.. '): + continue # first term of definition if in_definition: if not was_empty: @@ -315,7 +318,8 @@ class Glossary(Directive): term += system_messages defnode = nodes.definition() - self.state.nested_parse(definition, definition.items[0][1], defnode) + if definition: + self.state.nested_parse(definition, definition.items[0][1], defnode) items.append((termtexts, nodes.definition_list_item('', term, defnode))) |