Created a separate parser list for all parsers (except the unit parser

is replaced with the non-newline unit parser); use that parser when
parsing list lines
usingMegaparsec
Aadhavan Srinivasan 3 weeks ago
parent 04167e0f96
commit 6b99a1835d

@ -298,17 +298,16 @@ lineParsers =
parseUnit
] -- A 'line' doesn't include a 'header'
listLineParsers :: [Parser MdToken]
listLineParsers =
[ parseLinebreak,
parseEscapedChar,
lineParsersWithoutNewline :: [Parser MdToken]
lineParsersWithoutNewline =
[ parseEscapedChar,
parseCode,
parseImage,
parseBold,
parseItalic,
parseStrikethrough,
parseLink,
parseUnit
parseUnitExceptNewline
] -- A list line cannot contain newlines.
-- List of all parsers
@ -321,7 +320,7 @@ parseLineToken = fallthroughParser lineParsers
-- Parse any of the list line tokens.
parseListLineToken :: Parser MdToken
parseListLineToken = fallthroughParser listLineParsers
parseListLineToken = fallthroughParser lineParsersWithoutNewline
-- Parse a line, consisting of one or more tokens.
parseLine :: Parser MdToken

Loading…
Cancel
Save