From 1b821c43150ba4a06163f8ea8234bd52f6cbc6cd Mon Sep 17 00:00:00 2001 From: Rockingcool Date: Wed, 7 May 2025 14:20:51 -0500 Subject: [PATCH] Declare separate variable for escaped characters. --- src/MdToHTML.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/MdToHTML.hs b/src/MdToHTML.hs index b65444e..5b5deb5 100644 --- a/src/MdToHTML.hs +++ b/src/MdToHTML.hs @@ -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]