aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index 2cd1c0d83..169872391 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -133,17 +133,14 @@ indentSpaces = try $ do
nonindentSpaces :: PandocMonad m => MarkdownParser m String
nonindentSpaces = do
- tabStop <- getOption readerTabStop
- sps <- many (char ' ')
- if length sps < tabStop
- then return sps
- else unexpected "indented line"
+ n <- skipNonindentSpaces
+ return $ replicate n ' '
-- returns number of spaces parsed
skipNonindentSpaces :: PandocMonad m => MarkdownParser m Int
skipNonindentSpaces = do
tabStop <- getOption readerTabStop
- atMostSpaces (tabStop - 1) <* notFollowedBy (char ' ')
+ atMostSpaces (tabStop - 1) <* notFollowedBy spaceChar
atMostSpaces :: PandocMonad m => Int -> MarkdownParser m Int
atMostSpaces n