summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/Markdown.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/Readers/Markdown.hs')
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index 69faadd4a..4f1831baf 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -85,15 +85,13 @@ isBlank _ = False
indentSpaces :: Parser [Char] ParserState [Char]
indentSpaces = try $ do
- state <- getState
- let tabStop = stateTabStop state
+ tabStop <- getOption readerTabStop
count tabStop (char ' ') <|>
string "\t" <?> "indentation"
nonindentSpaces :: Parser [Char] ParserState [Char]
nonindentSpaces = do
- state <- getState
- let tabStop = stateTabStop state
+ tabStop <- getOption readerTabStop
sps <- many (char ' ')
if length sps < tabStop
then return sps
@@ -101,8 +99,8 @@ nonindentSpaces = do
skipNonindentSpaces :: Parser [Char] ParserState ()
skipNonindentSpaces = do
- state <- getState
- atMostSpaces (stateTabStop state - 1)
+ tabStop <- getOption readerTabStop
+ atMostSpaces (tabStop - 1)
atMostSpaces :: Int -> Parser [Char] ParserState ()
atMostSpaces 0 = notFollowedBy (char ' ')
@@ -627,8 +625,7 @@ defListMarker :: Parser [Char] ParserState ()
defListMarker = do
sps <- nonindentSpaces
char ':' <|> char '~'
- st <- getState
- let tabStop = stateTabStop st
+ tabStop <- getOption readerTabStop
let remaining = tabStop - (length sps + 1)
if remaining > 0
then count remaining (char ' ') <|> string "\t"