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:
@@ -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]
|
||||
|
Reference in New Issue
Block a user