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
This commit is contained in:
2025-06-10 09:12:42 -04:00
parent 04167e0f96
commit 6b99a1835d

View File

@@ -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