Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leading / in heading results in error #21

Open
bottd opened this issue Jan 4, 2025 · 1 comment
Open

Leading / in heading results in error #21

bottd opened this issue Jan 4, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@bottd
Copy link

bottd commented Jan 4, 2025

A heading beginning with / will result in a panic

* /my-heading
@benlubas
Copy link
Contributor

benlubas commented Jan 4, 2025

"test.norg" contains:
* /Heading
thread 'main' panicked at src/stage_3.rs:695:43:
called `Result::unwrap()` on an `Err` value: [Simple { span: 2..2, reason: Unexpected, expected: {Some(Special('<')), Some(Special('[')), Some(Special('`')), Some(Special('{'))}, found: None, label: None }]
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

We unwrap the result of parse_paragraph() which on first glace looks like it always returns Ok but it's got a ? in it, so it can fail.

I've experienced a similar case of this paragraph parsing logic failing. We should obviously go through an remove all the unwrap/expects now that this parser is used in a real plugin that people are using.

@NTBBloodbath NTBBloodbath added the bug Something isn't working label Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants