Muse reader: parse verse tag contents without parseFromString
This commit is contained in:
parent
05275be2cb
commit
264a25e5e9
1 changed files with 3 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue