mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Closes #1108: [text] Correctly number enumerated lists with non-default start values (based on patch by Ewan Edwards).
This commit is contained in:
parent
50d4aec15c
commit
66d799bb00
3
CHANGES
3
CHANGES
@ -1,6 +1,9 @@
|
|||||||
Release 1.2 (in development)
|
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
|
* #1074: Add environment version info to the generated search index to avoid
|
||||||
compatibility issues with old builds.
|
compatibility issues with old builds.
|
||||||
|
|
||||||
|
@ -550,7 +550,7 @@ class TextTranslator(nodes.NodeVisitor):
|
|||||||
self.list_counter.pop()
|
self.list_counter.pop()
|
||||||
|
|
||||||
def visit_enumerated_list(self, node):
|
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):
|
def depart_enumerated_list(self, node):
|
||||||
self.list_counter.pop()
|
self.list_counter.pop()
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@ Contents:
|
|||||||
extensions
|
extensions
|
||||||
versioning/index
|
versioning/index
|
||||||
footnote
|
footnote
|
||||||
|
lists
|
||||||
|
|
||||||
Python <http://python.org/>
|
Python <http://python.org/>
|
||||||
|
|
||||||
|
54
tests/root/lists.txt
Normal file
54
tests/root/lists.txt
Normal 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
|
||||||
|
|
||||||
|
#. {
|
Loading…
Reference in New Issue
Block a user