Created a separate list of escapable chars

fixingIncompleteElements
Aadhavan Srinivasan 2 weeks ago
parent f2d54edd3f
commit 3781e67ab1

@ -88,7 +88,9 @@ leftmostLongestParse parser input =
Nothing -> (mempty, mempty)
Just x -> x
specialChars = "\\#*_[\n"
specialChars = "\\#*_[\n`"
escapableChars = '~' : specialChars
-- Makes a parser greedy. Instead of returning all possible parses, only the longest one is returned.
greedyParse :: ReadP a -> ReadP [a]
@ -196,7 +198,7 @@ parseSingleNewline = do
parseEscapedChar :: ReadP MdToken
parseEscapedChar = do
char '\\'
escapedChar <- choice (map char specialChars) -- Parse any of the special chars.
escapedChar <- choice (map char escapableChars) -- Parse any of the special chars.
return (Unit [escapedChar])
-- Parse a character as a Unit.

Loading…
Cancel
Save