-
Notifications
You must be signed in to change notification settings - Fork 393
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
Escape all Jupyter magics by default #94
Comments
Thanks @theolamayo . I'm glad you like it! I had a second look at #35 , and also at the corresponding unit test, and I am now wondering why I did not simply match magics as commands starting with one or two percent signs... Are you aware of any plain Python instruction that would start with a percent sign? Do you think we could actually escape any percent command? |
Indeed I am not aware of any plain Python instruction that starts with a percent sign. You mentioned Pytest features and decorators in #29 (comment) but they start with a @ sign. Answers on https://stackoverflow.com/questions/961344/what-does-the-percentage-sign-mean-in-python only mention IPython magics as valid instructions starting with a percent sign. I also think we could escape any percent command. |
Thanks @theolamayo . Probably there had been a sleepless night before #29... sure, pytest decorators start with @, not %! I also doubled check with Doug at #61, all instructions starting with a single percent sign (up to three actually) are magics. I don't have a excuse now not to fix this... I will do that very soon! |
@theolamayo , the new release (v0.8.0) should have support for all magics. Please reopen if that is not the case! Thanks |
First thanks for this great tool!
I often use the
%watermark
(https://github.com/rasbt/watermark) magic extension in my notebooks, adding it to the escaped magics would be useful.I second the idea of adding a configurable list of magics to be escaped as suggested in #35, notably for custom magics.
The text was updated successfully, but these errors were encountered: