-
Notifications
You must be signed in to change notification settings - Fork 229
Open
Labels
good first issueGood for newcomersGood for newcomers
Description
I've found a markdown document that causes a fatal error when parsing. While the document itself is fairly useless, I feel like the library should attempt to never fatal error, as this makes detecting and recovering from errors impossible in code that uses it.
Example code:
let text = try String(contentsOfFile: "example.md")
_ = Document(parsing: text, options: [.parseBlockDirectives, .parseSymbolLinks])
This crashes. It looks like it's something to do with CRLF line endings because this does not crash:
var text = try String(contentsOfFile: "example.md")
text = text.replacingOccurrences(of: "\r\n", with: "\n")
_ = Document(parsing: text, options: [.parseBlockDirectives, .parseSymbolLinks])
The example file that triggers this is attached. I am not pasting it in because it's line ending specific.
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers