-
-
Notifications
You must be signed in to change notification settings - Fork 96
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
Add catch for None type code block in lesson_check #558
Conversation
There are times when the AST is malformed and does not emit a class for the code element. We do not want the parser to crash when this happens, but we also want to notify ourselves that the AST is malformed. This should not result in an error because as we saw in carpentries#543, the parser itself can cause these malformations when the lesson itself renders well. Even though we fixed the previous issue with an updated parser, problems still persist: swcarpentry/r-novice-gapminder#696 (comment) I fully admit that this is a kludge.
I've removed the print condition, because it will just result in an error no matter what (sigh)
Note: when testing on https://github.com/swcarpentry/r-novice-gapminder/tree/a2bf86ecdcb27d5442d8a7366776a50f5b56fad3 with the current branch, I get the following output
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! 👍🏻
Those |
I looked into it and there was a situation where someone added the callout block at the bottom of an R code block, so it is a bona-fide error. |
Thank you for the quick review @maxim-belkin! |
There are times when the AST is malformed and does not emit a class for
the code element. We do not want the parser to crash when this happens,
but we also want to notify ourselves that the AST is malformed.
This should not result in an error because as we saw in
#543, the parser itself can
cause these malformations when the lesson itself renders well. Even
though we fixed the previous issue with an updated parser, problems
still persist:
swcarpentry/r-novice-gapminder#696 (comment)
I fully admit that this is a kludge.
This will fix #550