testParserFile = manyTill anyChar newline *> endBy testParser eol
manyTill p end
applies p until end
succeeds. *>
sequences two actions and discards the first value.
Note: if your actual file doesn't contain a newline at the end, then you need to use sepEndBy
instead of endBy
. However, this could be a result of the Markdown parser on StackOverflow.