diff options
author | Alexander Krotov <ilabdsf@gmail.com> | 2018-01-28 22:09:47 +0300 |
---|---|---|
committer | Alexander Krotov <ilabdsf@gmail.com> | 2018-01-28 22:09:47 +0300 |
commit | 264a25e5e98c252dba87b63dceda6539e93461aa (patch) | |
tree | 6874ed6363ae941a854a9510c92ef5f8f5f8be53 /src | |
parent | 05275be2cb576561b36a111d04fb42a197ddbab6 (diff) | |
download | pandoc-264a25e5e98c252dba87b63dceda6539e93461aa.tar.gz |
Muse reader: parse verse tag contents without parseFromString
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Readers/Muse.hs | 7 |
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 |