aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Krotov <ilabdsf@gmail.com>2018-10-05 19:14:13 +0300
committerAlexander Krotov <ilabdsf@gmail.com>2018-10-05 19:14:13 +0300
commit37cc977b12233203f0af27a15918e7d5b73189c5 (patch)
tree40665971910a15225558877cb7feca7acc5607b2
parent131dcff71d65c343d1721ec0e577b5a773d9e737 (diff)
downloadpandoc-37cc977b12233203f0af27a15918e7d5b73189c5.tar.gz
Muse reader: use getIndent more for code cleanup
-rw-r--r--src/Text/Pandoc/Readers/Muse.hs11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs
index a87ce97a2..404636c54 100644
--- a/src/Text/Pandoc/Readers/Muse.hs
+++ b/src/Text/Pandoc/Readers/Muse.hs
@@ -458,12 +458,10 @@ verseLine = (<>)
-- | Parse @\<verse>@ tag.
verseTag :: PandocMonad m => MuseParser m (F Blocks)
verseTag = try $ do
- many spaceChar
- pos <- getPosition
+ indent <- getIndent
openTag "verse"
manyTill spaceChar eol
- let indent = count (sourceColumn pos - 1) spaceChar
- content <- sequence <$> manyTill (indent *> verseLine) (try $ indent *> closeTag "verse")
+ content <- sequence <$> manyTill (count indent spaceChar *> verseLine) (try $ count indent spaceChar *> closeTag "verse")
manyTill spaceChar eol
return $ B.lineBlock <$> content
@@ -541,9 +539,8 @@ emacsNoteBlock = 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 <- (blankVerseLine <|> nonblankVerseLine) `sepBy1'` try (indentWith (col - 1))
+ indent <- getIndent
+ lns <- (blankVerseLine <|> nonblankVerseLine) `sepBy1'` try (indentWith indent)
return $ B.lineBlock <$> sequence lns
where
blankVerseLine = try $ mempty <$ char '>' <* blankline