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

The '!' magic does not work when followed by non-alphabetical characters #938

Open
narensrini opened this issue Mar 23, 2022 · 2 comments
Open

Comments

@narensrini
Copy link

If I have a cell of the following form:

x = "echo"
!{x} "hello world"

This is valid jupyter syntax, and it prints out "foo" to stdout via a shell process.

However, the percent representation in jupytext outputs the following:

# %%
x = "echo"
!{x} "hello world"

This is incorrect - the line should be commented out in the percent syntax after recognizing the magic.

This will also fail when running bash commands that do not begin with an alphabetical character (eg. ':', '$!')

It looks like a fix that updates the regex in #819 would work here.

@Skylion007
Copy link
Contributor

This seems to be an extension of the issue with #587 . The Regex needs to be expanded to include {}.

Skylion007 added a commit to Skylion007/jupytext that referenced this issue Mar 30, 2022
mwouts pushed a commit that referenced this issue Apr 3, 2022
@mwouts
Copy link
Owner

mwouts commented Apr 3, 2022

This will also fail when running bash commands that do not begin with an alphabetical character (eg. ':', '$!')

@narensrini , we have changed the regex to escape the pattern !{x}, but you seem to mention other cases, would you like to give a few more examples that you'd like to see supported? Thanks

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

No branches or pull requests

3 participants