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