-
-
Notifications
You must be signed in to change notification settings - Fork 0
failure on shell commands after %%time #11
Copy link
Copy link
Open
Description
Hi, thanks for your work!
I encountered the following issue when using this lexer to highlight the contents of a jupyter notebook cell.
%%time
!run_command
This should time the runtime of run_command, but instead it fails on ! because the lexer assumes that whatever comes after %%time should be handled by the normal python lexer.
Reproducing snippet:
from pygments import highlight
from pygments.formatters import TerminalFormatter
from pygments.lexers import get_lexer_by_name
lexer = get_lexer_by_name("ipython3")
code = "%%time\n!cmd"
print(highlight(code, lexer, TerminalFormatter()))Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels