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

fixingIncompleteElements
Aadhavan Srinivasan 2 weeks ago
parent eb20f154a4
commit 234145bcb3

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

Loading…
Cancel
Save