mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix: `make text will crush if a definition list item has more than 1 classifiers as: term : classifier1 : classifier2`.
This commit is contained in:
3
CHANGES
3
CHANGES
@@ -37,6 +37,9 @@ Bugs fixed
|
||||
* #1923: Use babel features only if the babel latex element is nonempty.
|
||||
* #1942: Fix a KeyError in websupport.
|
||||
* #1903: Fix strange id generation for glossary terms.
|
||||
* #1796, On py3, automated .mo building cause UnicodeDecodeError
|
||||
* Fix: ``make text`` will crush if a definition list item has more than 1 classifiers as:
|
||||
``term : classifier1 : classifier2``.
|
||||
|
||||
|
||||
Release 1.3.1 (released Mar 17, 2015)
|
||||
|
||||
@@ -628,8 +628,7 @@ class TextTranslator(nodes.NodeVisitor):
|
||||
self.end_state(first='%s. ' % self.list_counter[-1])
|
||||
|
||||
def visit_definition_list_item(self, node):
|
||||
self._li_has_classifier = len(node) >= 2 and \
|
||||
isinstance(node[1], nodes.classifier)
|
||||
self._classifier_count_in_li = len(node.traverse(nodes.classifier))
|
||||
|
||||
def depart_definition_list_item(self, node):
|
||||
pass
|
||||
@@ -638,7 +637,7 @@ class TextTranslator(nodes.NodeVisitor):
|
||||
self.new_state(0)
|
||||
|
||||
def depart_term(self, node):
|
||||
if not self._li_has_classifier:
|
||||
if not self._classifier_count_in_li:
|
||||
self.end_state(end=None)
|
||||
|
||||
def visit_termsep(self, node):
|
||||
@@ -649,7 +648,9 @@ class TextTranslator(nodes.NodeVisitor):
|
||||
self.add_text(' : ')
|
||||
|
||||
def depart_classifier(self, node):
|
||||
self.end_state(end=None)
|
||||
self._classifier_count_in_li -= 1
|
||||
if not self._classifier_count_in_li:
|
||||
self.end_state(end=None)
|
||||
|
||||
def visit_definition(self, node):
|
||||
self.new_state()
|
||||
|
||||
Reference in New Issue
Block a user