aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Krotov <ilabdsf@gmail.com>2018-02-16 12:53:41 +0300
committerAlexander Krotov <ilabdsf@gmail.com>2018-02-16 12:53:41 +0300
commit0e4b8ae36296030569627baa537b9d71af621d20 (patch)
tree8f4ebc13de0b3143c0889512d424627098e591ec
parente6ff7f79861d3088f8cba2b22d86d9f75db73f6a (diff)
downloadpandoc-0e4b8ae36296030569627baa537b9d71af621d20.tar.gz
Muse reader: prioritize lists with roman numerals over alphabetical lists
This is to make sure "i." starts a roman numbered list, instead of a list with letter "i" (followed by "j", "k", ...").
-rw-r--r--src/Text/Pandoc/Readers/Muse.hs2
-rw-r--r--test/Tests/Readers/Muse.hs12
2 files changed, 13 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs
index 7504a33ca..a842925a2 100644
--- a/src/Text/Pandoc/Readers/Muse.hs
+++ b/src/Text/Pandoc/Readers/Muse.hs
@@ -576,7 +576,7 @@ bulletListUntil end = try $ do
-- | Parses an ordered list marker and returns list attributes.
anyMuseOrderedListMarker :: PandocMonad m => MuseParser m ListAttributes
anyMuseOrderedListMarker = do
- (style, start) <- decimal <|> lowerAlpha <|> lowerRoman <|> upperAlpha <|> upperRoman
+ (style, start) <- decimal <|> lowerRoman <|> upperRoman <|> lowerAlpha <|> upperAlpha
char '.'
return (start, style, Period)
diff --git a/test/Tests/Readers/Muse.hs b/test/Tests/Readers/Muse.hs
index faa21513a..2a350d252 100644
--- a/test/Tests/Readers/Muse.hs
+++ b/test/Tests/Readers/Muse.hs
@@ -767,6 +767,18 @@ tests =
, para "Item2"
, para "Item3"
]
+ , "Ordered list with roman numerals" =:
+ T.unlines
+ [ " i. First"
+ , " ii. Second"
+ , " iii. Third"
+ , " iv. Fourth"
+ ] =?>
+ orderedListWith (1, LowerRoman, Period) [ para "First"
+ , para "Second"
+ , para "Third"
+ , para "Fourth"
+ ]
, "Bullet list with empty items" =:
T.unlines
[ " -"