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 ['*', '+', '-'])
|
firstChar <- choice (map char ['*', '+', '-'])
|
||||||
char ' ' -- At least one space between list indicator and list text.
|
char ' ' -- At least one space between list indicator and list text.
|
||||||
skipSpaces
|
skipSpaces
|
||||||
restOfLine <- manyTill get (void (char '\n') <++ eof)
|
restOfLine <- many1 parseListLineToken
|
||||||
let restOfLineParsed = fst $ leftmostLongestParse parseLine restOfLine
|
void (char '\n') <++ eof
|
||||||
nestedList <- parseUListNested <++ return (Unit "")
|
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.
|
-- Parse an unordered list paragraph item.
|
||||||
-- This is defined as a line item, followed by an empty line, followed by one or more
|
-- This is defined as a line item, followed by an empty line, followed by one or more
|
||||||
|
Reference in New Issue
Block a user