diff options
-rw-r--r-- | src/Text/Pandoc/Readers/Muse.hs | 1 | ||||
-rw-r--r-- | test/Tests/Readers/Muse.hs | 18 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs index 1ba4ac343..98c1a9d55 100644 --- a/src/Text/Pandoc/Readers/Muse.hs +++ b/src/Text/Pandoc/Readers/Muse.hs @@ -558,6 +558,7 @@ blanklineVerseLine = try $ do -- | Parse a line block indicated by @\'>\'@ characters. lineBlock :: PandocMonad m => MuseParser m (F Blocks) lineBlock = try $ do + many spaceChar col <- sourceColumn <$> getPosition lns <- (blanklineVerseLine <|> lineVerseLine) `sepBy1'` try (indentWith (col - 1)) return $ B.lineBlock <$> sequence lns diff --git a/test/Tests/Readers/Muse.hs b/test/Tests/Readers/Muse.hs index 86f0d7888..8474b2509 100644 --- a/test/Tests/Readers/Muse.hs +++ b/test/Tests/Readers/Muse.hs @@ -1153,6 +1153,24 @@ tests = definitionList [ ("First term", [ para "Definition of first term\nand its continuation." ]) , ("Second term", [ para "Definition of second term." ]) ] + , "Definition list with verse" =: + T.unlines + [ " First term :: Definition of first term" + , " > First verse" + , " > Second line of first verse" + , "" + , " > Second verse" + , " > Second line of second verse" + ] =?> + definitionList [ ("First term", [ para "Definition of first term" <> + lineBlock [ text "First verse" + , text "Second line of first verse" + ] <> + lineBlock [ text "Second verse" + , text "Second line of second verse" + ] + ]) + ] , test emacsMuse "Multi-line definition lists from Emacs Muse manual" (T.unlines [ "Term1 ::" |