Started working on parsing changes to allow incomplete elements to be parsed (eg. opening bold, followed by text, without closing bold)

This commit is contained in:
2025-05-20 22:21:59 -04:00
parent eb20f154a4
commit 234145bcb3

View File

@@ -143,7 +143,7 @@ parseBold = parseBoldWith "**" <|> parseBoldWith "__"
where
parseBoldWith delim = do
string delim
inside <- greedyParse1 parseLineToken
inside <- many1 parseLineToken
string delim
return (Bold (Line inside))
@@ -153,7 +153,7 @@ parseItalic = parseItalicWith "*" <|> parseItalicWith "_"
where
parseItalicWith delim = do
string delim
inside <- greedyParse1 parseLineToken
inside <- many1 parseLineToken
string delim
return (Italic (Line inside))
@@ -204,7 +204,8 @@ parseEscapedChar = do
-- Parse a character as a Unit.
parseUnit :: ReadP MdToken
parseUnit = do
text <- satisfy (`notElem` specialChars)
-- text <- satisfy (`notElem` specialChars)
text <- get
return (Unit [text])
lineParsers :: [ReadP MdToken]