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

handle unknown markdown #133

Merged
merged 4 commits into from
Jul 17, 2024
Merged

handle unknown markdown #133

merged 4 commits into from
Jul 17, 2024

Conversation

yshavit
Copy link
Owner

@yshavit yshavit commented Jul 17, 2024

I have two spots in the code that I wasn't able to produce cases for. I
suspect these can't happen, but just in case, I'm going to put basically
an overridable panic of sorts. By default, hitting either of these cases
will result in an error; but if you provide the hidden
--allow-unknown-markdown flag, we'll just ignore them.

I can't test this (if I knew how to hit these branches, I wouldn't need
it!), but I manually added a lookups.unknown_markdown("testing")?; in
MdElem::read to verify that (a) it correctly errors out without the
flag, and (b) it correctly succeeds with the flag.

As part of this, I added better handling for the Err case of MdElem::read.

Also, replace a TODO with a reference to #84.

This PR removes all the TODOs for #11. Once it gets merged, I'll check the last checkbox on that ticket and manually close it.

yshavit added 4 commits July 16, 2024 23:57
Reference #84 in the code

In service of #11
I have two spots in the code that I wasn't able to produce cases for. I
suspect these can't happen, but just in case, I'm going to put basically
an overridable panic of sorts. By default, hitting either of these cases
will result in an error; but if you provide the hidden
`--allow-unknown-markdown` flag, we'll just ignore them.

I can't test this (if I knew how to hit these branches, I wouldn't need
it!), but I manually added a `lookups.unknown_markdown("testing")?;` in
`MdElem::read` to verify that (a) it correctly errors out without the
flag, and (b) it correctly succeeds with the flag.
@yshavit yshavit merged commit 3ff304d into main Jul 17, 2024
4 checks passed
@yshavit yshavit deleted the rm-todo branch July 17, 2024 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant