Closes #1108: [text] Correctly number enumerated lists with non-default start values (based on patch by Ewan Edwards).

This commit is contained in:
Jonathan Waltman 2013-02-20 13:50:40 -06:00
parent 50d4aec15c
commit 66d799bb00
4 changed files with 59 additions and 1 deletions

View File

@ -1,6 +1,9 @@
Release 1.2 (in development)
============================
* #1108: The text writer now correctly numbers enumerated lists with
non-default start values (based on patch by Ewan Edwards).
* #1074: Add environment version info to the generated search index to avoid
compatibility issues with old builds.

View File

@ -550,7 +550,7 @@ class TextTranslator(nodes.NodeVisitor):
self.list_counter.pop()
def visit_enumerated_list(self, node):
self.list_counter.append(0)
self.list_counter.append(node.get('start', 1) - 1)
def depart_enumerated_list(self, node):
self.list_counter.pop()

View File

@ -28,6 +28,7 @@ Contents:
extensions
versioning/index
footnote
lists
Python <http://python.org/>

54
tests/root/lists.txt Normal file
View File

@ -0,0 +1,54 @@
Various kinds of lists
======================
nested enumerated lists
-----------------------
#. one
#. two
#. two.1
#. two.2
#. three
enumerated lists with non-default start values
----------------------------------------------
0. zero
#. one
----------------------------------------
1. one
#. two
----------------------------------------
2. two
#. three
enumerated lists using letters
------------------------------
a. a
b. b
#. c
#. d
----------------------------------------
x. x
y. y
#. z
#. {