Closed PMunch closed 1 year ago
Try with current head, which should fix this specific issue. You can now handle the YamlParserError
that is raised from this.
NimYAML hasn't been thoroughly tested with garbage / incomplete input, so there may be other cases that are not caught properly. Report back if you find others.
Works a treat, thanks a lot! I'll let you know if I discover more bugs
I was trying to use NimYAML to parse the frontmatter for a Markdown editor. The editor itself updates the output automatically as the user types. This means that the user is able to type things into the frontmatter as they go and the frontmatter is attempted updated for every step. The problem came when I tried to enter a string with quotes, the following YAML, although obviously incorrect, crashes my entire program instead of just throwing a YAML parsing error:
Since I can't catch the error I can't simply silently ignore the invalid frontmatter and I could never parse YAML in a safe manner without risking my program to quit..