aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2009-06-28 01:38:40 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2009-06-28 01:38:40 +0000
commit32f357c1108306b35a8d7ccbf2503a733ca9b529 (patch)
tree20a138b9bea4a749ac9b522d888dd34e8aed600e
parent313405f59aa09b6f1a027002d35bc75cb15c976e (diff)
downloadpandoc-32f357c1108306b35a8d7ccbf2503a733ca9b529.tar.gz
RST reader: Allow # to continue list...
...even if the list was started with an explicit marker. For example: A. my list #. continued Resolves Issue #140. Test case also added. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1584 788f1e2b-df1e-0410-8736-df70ead52e1b
-rw-r--r--src/Text/Pandoc/Shared.hs5
-rw-r--r--tests/rst-reader.native4
-rw-r--r--tests/rst-reader.rst5
3 files changed, 12 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs
index 82ae08601..b67e169c8 100644
--- a/src/Text/Pandoc/Shared.hs
+++ b/src/Text/Pandoc/Shared.hs
@@ -612,8 +612,9 @@ orderedListMarker :: ListNumberStyle
-> ListNumberDelim
-> GenParser Char st Int
orderedListMarker style delim = do
- let num = case style of
- DefaultStyle -> decimal <|> defaultNum
+ let num = defaultNum <|> -- # can continue any kind of list
+ case style of
+ DefaultStyle -> decimal
Decimal -> decimal
UpperRoman -> upperRoman
LowerRoman -> lowerRoman
diff --git a/tests/rst-reader.native b/tests/rst-reader.native
index 88a036ebc..8848fa111 100644
--- a/tests/rst-reader.native
+++ b/tests/rst-reader.native
@@ -146,6 +146,10 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite",Str ":",Space,Str
, OrderedList (1,DefaultStyle,DefaultDelim)
[ [ Plain [Str "Nested."] ]
] ] ]
+, Para [Str "Autonumbering",Space,Str "with",Space,Str "explicit",Space,Str "start",Str ":"]
+, OrderedList (4,LowerAlpha,TwoParens)
+ [ [ Plain [Str "item",Space,Str "1"] ]
+ , [ Plain [Str "item",Space,Str "2"] ] ]
, Header 2 [Str "Definition"]
, DefinitionList
[ ([Str "term",Space,Str "1"],
diff --git a/tests/rst-reader.rst b/tests/rst-reader.rst
index 2fcb4a5b9..2cc99d294 100644
--- a/tests/rst-reader.rst
+++ b/tests/rst-reader.rst
@@ -242,6 +242,11 @@ Autonumbering:
#. Nested.
+Autonumbering with explicit start:
+
+(d) item 1
+(#) item 2
+
Definition
----------