mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Closes #797: Don't crash on a misformatted glossary.
This commit is contained in:
2
CHANGES
2
CHANGES
@@ -1,6 +1,8 @@
|
||||
Release 1.1.1 (in development)
|
||||
==============================
|
||||
|
||||
* #797: Don't crash on a misformatted glossary.
|
||||
|
||||
* #801: Make intersphinx work properly without SSL support.
|
||||
|
||||
* #805: Make the ``Sphinx.add_index_to_domain`` method work correctly.
|
||||
|
||||
@@ -259,13 +259,23 @@ class Glossary(Directive):
|
||||
messages.append(self.state.reporter.system_message(
|
||||
2, 'glossary terms must not be separated by empty '
|
||||
'lines', source=source, line=lineno))
|
||||
entries[-1][0].append((line, source, lineno))
|
||||
if entries:
|
||||
entries[-1][0].append((line, source, lineno))
|
||||
else:
|
||||
messages.append(self.state.reporter.system_message(
|
||||
2, 'glossary seems to be misformatted, check '
|
||||
'indentation', source=source, line=lineno))
|
||||
else:
|
||||
if not in_definition:
|
||||
# first line of definition, determines indentation
|
||||
in_definition = True
|
||||
indent_len = len(line) - len(line.lstrip())
|
||||
entries[-1][1].append(line[indent_len:], source, lineno)
|
||||
if entries:
|
||||
entries[-1][1].append(line[indent_len:], source, lineno)
|
||||
else:
|
||||
messages.append(self.state.reporter.system_message(
|
||||
2, 'glossary seems to be misformatted, check '
|
||||
'indentation', source=source, line=lineno))
|
||||
was_empty = False
|
||||
|
||||
# now, parse all the entries into a big definition list
|
||||
|
||||
Reference in New Issue
Block a user