Closed dpbriggs closed 4 years ago
Thanks for bring this up! This's definitely a bug. The parser takes the trailing newline as a table row by mistake:
It shouldn't be hard to fix and I'm working on it right now.
but would it be possible to avoid panicking?
Unfortunately, no. The parser will not paincs in any cases and there's no need to avoid.
so we could recover from malformed org-mode files.
In fact, Org::validate
is used for validating the Org
struct itself, not the input string. Actually, any string is a validate org-mode string and Org::parse
is guaranteed to return a valid Org
struct.
To sum up, if you're just parsing and rendering org-mode files, you don't need to validate anything. Calling the Org::validate
function only when you have modified the inner arena via Org::arena_mut
.
Also, I'm very happy to know that you're bring the org-mode feature to crates.io! Feel free to contact me at any time if you have problem about orgize.
Ok, the bug is fixed now. There's still something I want to change also, so I will release it a bit late.
Also, I had updated the panic message. Like I explained above, Org::parse
is expected to return a valid Org
struct.
Hey thank you so much! You're the best
Hi! I wanted to thank you for making this great crate. I'm currently using orgize to add org rendering to crates.io and the background workers are panicking when they encounter tables:
This isn't a problem, per se, but would it be possible to avoid panicking? Ideally we'll have a
so we could recover from malformed org-mode files.
I could open a PR if you'd like :P