mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-24 15:44:59 +08:00
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
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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"],
|
||||
|
||||
@@ -242,6 +242,11 @@ Autonumbering:
|
||||
|
||||
#. Nested.
|
||||
|
||||
Autonumbering with explicit start:
|
||||
|
||||
(d) item 1
|
||||
(#) item 2
|
||||
|
||||
Definition
|
||||
----------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user