summaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorAlexander <ilabdsf@gmail.com>2017-08-06 23:19:59 +0300
committerJohn MacFarlane <jgm@berkeley.edu>2017-08-06 13:19:59 -0700
commit8164a005c0ac9e36d9d1485fcf38e9073a1bcd68 (patch)
tree27c0e48d96e5f501ebd714752904f23520289594 /src/Text
parent685788cd4b13d2162dc011e8f3826da37522e59b (diff)
Muse reader: debug list and list item separation rules (#3837)
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Readers/Muse.hs9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs
index ca40cebe3..201a59fc0 100644
--- a/src/Text/Pandoc/Readers/Muse.hs
+++ b/src/Text/Pandoc/Readers/Muse.hs
@@ -302,7 +302,6 @@ noteBlock = try $ do
listLine :: PandocMonad m => Int -> MuseParser m String
listLine markerLength = try $ do
- notFollowedBy blankline
indentWith markerLength
anyLineNewline
@@ -317,9 +316,9 @@ withListContext p = do
listContinuation :: PandocMonad m => Int -> MuseParser m String
listContinuation markerLength = try $ do
- blanks <- many1 blankline
result <- many1 $ listLine markerLength
- return $ blanks ++ concat result
+ blank <- option "" ("\n" <$ blankline)
+ return $ concat result ++ blank
listStart :: PandocMonad m => MuseParser m Int -> MuseParser m Int
listStart marker = try $ do
@@ -334,9 +333,9 @@ listItem :: PandocMonad m => MuseParser m Int -> MuseParser m (F Blocks)
listItem start = try $ do
markerLength <- start
firstLine <- anyLineNewline
- blank <- option "" ("\n" <$ blankline)
restLines <- many $ listLine markerLength
- let first = firstLine ++ blank ++ concat restLines
+ blank <- option "" ("\n" <$ blankline)
+ let first = firstLine ++ concat restLines ++ blank
rest <- many $ listContinuation markerLength
parseFromString (withListContext parseBlocks) $ concat (first:rest) ++ "\n"