Declare separate variable for escaped characters.
This commit is contained in:
@@ -83,6 +83,8 @@ lookaheadParse stringCmp = do
|
||||
lineToList :: MdToken -> [MdToken]
|
||||
lineToList (Line tokens) = tokens
|
||||
|
||||
specialChars = "\\#*_[\n "
|
||||
|
||||
-- ---------------
|
||||
|
||||
-- Parse a markdown header, denoted by 1-6 #'s followed by some text, followed by EOL.
|
||||
@@ -138,7 +140,7 @@ parseSingleNewline = do
|
||||
parseString :: ReadP MdToken
|
||||
parseString = do
|
||||
firstChar <- satisfy (/= '\n') -- Must parse at least one non-newline character here
|
||||
text <- munch (`notElem` "#*_[\n ")
|
||||
text <- munch (`notElem` specialChars)
|
||||
return (Unit (firstChar : text))
|
||||
|
||||
lineParsers :: [ReadP MdToken]
|
||||
|
Reference in New Issue
Block a user