Use the in-order parsing approach instead of the post-order one.
This commit is contained in:
@@ -335,10 +335,15 @@ parseUListLineItem = do
|
||||
firstChar <- choice (map char ['*', '+', '-'])
|
||||
char ' ' -- At least one space between list indicator and list text.
|
||||
skipSpaces
|
||||
restOfLine <- manyTill get (void (char '\n') <++ eof)
|
||||
let restOfLineParsed = fst $ leftmostLongestParse parseLine restOfLine
|
||||
restOfLine <- many1 parseListLineToken
|
||||
void (char '\n') <++ eof
|
||||
nestedList <- parseUListNested <++ return (Unit "")
|
||||
return $ Line [restOfLineParsed, nestedList]
|
||||
return $ Line [Line restOfLine, nestedList]
|
||||
|
||||
-- restOfLine <- manyTill get (void (char '\n') <++ eof)
|
||||
-- let restOfLineParsed = fst $ leftmostLongestParse parseLine restOfLine
|
||||
-- nestedList <- parseUListNested <++ return (Unit "")
|
||||
-- return $ Line [restOfLineParsed, nestedList]
|
||||
|
||||
-- Parse an unordered list paragraph item.
|
||||
-- This is defined as a line item, followed by an empty line, followed by one or more
|
||||
|
Reference in New Issue
Block a user