git.iko.soy/typeable/pandoc
on master help sign in
More perspicuous definition of nonindentSpaces.
f8f9fa4fiddlosopher
src/Text/Pandoc/Readers/Markdown.hs+4−1
@@ -74,7 +74,10 @@ indentSpaces = try $ do
74nonindentSpaces = do
74nonindentSpaces = do
75 state <- getState
75 state <- getState
76 let tabStop = stateTabStop state
76 let tabStop = stateTabStop state
77− choice $ map (\n -> (try (count n (char ' ')))) $ reverse [0..(tabStop - 1)]
77+ sps <- many (char ' ')
78+ if length sps < tabStop
79+ then return sps
80+ else unexpected "indented line"
78
81
79-- | Fail unless we're at beginning of a line.
82-- | Fail unless we're at beginning of a line.
80failUnlessBeginningOfLine = do
83failUnlessBeginningOfLine = do