aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexander Krotov <ilabdsf@gmail.com>2018-01-28 22:09:47 +0300
committerAlexander Krotov <ilabdsf@gmail.com>2018-01-28 22:09:47 +0300
commit264a25e5e98c252dba87b63dceda6539e93461aa (patch)
tree6874ed6363ae941a854a9510c92ef5f8f5f8be53 /src
parent05275be2cb576561b36a111d04fb42a197ddbab6 (diff)
downloadpandoc-264a25e5e98c252dba87b63dceda6539e93461aa.tar.gz
Muse reader: parse verse tag contents without parseFromString
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Readers/Muse.hs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs
index 27d5922a0..97f8a963f 100644
--- a/src/Text/Pandoc/Readers/Muse.hs
+++ b/src/Text/Pandoc/Readers/Muse.hs
@@ -304,10 +304,9 @@ divTag = do
verseLine :: PandocMonad m => MuseParser m (F Inlines)
verseLine = do
- line <- anyLine <|> many1Till anyChar eof
- let (white, rest) = span (== ' ') line
- let s = replicate (length white) '\160' ++ rest
- parseFromString' (trimInlinesF . mconcat <$> many inline) s
+ indent <- (B.str <$> many1 (char ' ' >> pure '\160')) <|> (pure mempty)
+ rest <- manyTill (choice inlineList) newline
+ return $ trimInlinesF $ mconcat (pure indent : rest)
verseLines :: PandocMonad m => MuseParser m (F Blocks)
verseLines = do