Fixed newline bug; working on fixing the last failing test
This commit is contained in:
@@ -137,12 +137,13 @@ parseSingleNewline = do
|
|||||||
-- Parse a regular string as a Unit.
|
-- Parse a regular string as a Unit.
|
||||||
parseString :: ReadP MdToken
|
parseString :: ReadP MdToken
|
||||||
parseString = do
|
parseString = do
|
||||||
firstChar <- get -- Must parse at least one character here
|
firstChar <- satisfy (/= '\n') -- Must parse at least one non-newline character here
|
||||||
text <- munch (\x -> not (elem x "#*_[\n "))
|
text <- munch (\x -> not (elem x "#*_[\n "))
|
||||||
return (Unit (firstChar : text))
|
return (Unit (firstChar : text))
|
||||||
|
|
||||||
lineParsers :: [ReadP MdToken]
|
lineParsers :: [ReadP MdToken]
|
||||||
lineParsers = [parseLinebreak, parseSingleNewline, parseBold, parseItalic, parseString] -- A 'line' doesn't include a 'header'
|
lineParsers = [parseLinebreak, parseSingleNewline, parseBold, parseItalic, parseString] -- A 'line' doesn't include a 'header'
|
||||||
|
--lineParsers = [parseSingleNewline, parseString]
|
||||||
|
|
||||||
-- List of all parsers
|
-- List of all parsers
|
||||||
allParsers :: [ReadP MdToken]
|
allParsers :: [ReadP MdToken]
|
||||||
|
Reference in New Issue
Block a user