@@ -85,15 +85,13 @@ isBlank _ = False
86indentSpaces :: Parser [Char] ParserState [Char]
86indentSpaces :: Parser [Char] ParserState [Char]
87indentSpaces = try $ do
87indentSpaces = try $ do
88− state <- getState
88+ tabStop <- getOption readerTabStop
89− let tabStop = stateTabStop state
90 count tabStop (char ' ') <|>
89 count tabStop (char ' ') <|>
91 string "\t" <?> "indentation"
90 string "\t" <?> "indentation"
93nonindentSpaces :: Parser [Char] ParserState [Char]
92nonindentSpaces :: Parser [Char] ParserState [Char]
94nonindentSpaces = do
93nonindentSpaces = do
95− state <- getState
94+ tabStop <- getOption readerTabStop
96− let tabStop = stateTabStop state
97 sps <- many (char ' ')
95 sps <- many (char ' ')
98 if length sps < tabStop
96 if length sps < tabStop
99 then return sps
97 then return sps
@@ -101,8 +99,8 @@ nonindentSpaces = do
102skipNonindentSpaces :: Parser [Char] ParserState ()
100skipNonindentSpaces :: Parser [Char] ParserState ()
103skipNonindentSpaces = do
101skipNonindentSpaces = do
104− state <- getState
102+ tabStop <- getOption readerTabStop
105− atMostSpaces (stateTabStop state - 1)
103+ atMostSpaces (tabStop - 1)
107atMostSpaces :: Int -> Parser [Char] ParserState ()
105atMostSpaces :: Int -> Parser [Char] ParserState ()
108atMostSpaces 0 = notFollowedBy (char ' ')
106atMostSpaces 0 = notFollowedBy (char ' ')
@@ -627,8 +625,7 @@ defListMarker :: Parser [Char] ParserState ()
627defListMarker = do
625defListMarker = do
628 sps <- nonindentSpaces
626 sps <- nonindentSpaces
629 char ':' <|> char '~'
627 char ':' <|> char '~'
630− st <- getState
628+ tabStop <- getOption readerTabStop
631− let tabStop = stateTabStop st
632 let remaining = tabStop - (length sps + 1)
629 let remaining = tabStop - (length sps + 1)
633 if remaining > 0
630 if remaining > 0
634 then count remaining (char ' ') <|> string "\t"
631 then count remaining (char ' ') <|> string "\t"