ipython / ipython/ipython-pygments-lexers
failure on shell commands after `%%time`
未關閉
- 主要語言
- Python
- 星號
- 0
- 分支
- 2
- 平均合併
- 12 天 21 小時
- 30 天內合併 PR
- 1
描述
Hi, thanks for your work!
I encountered the following issue when using this lexer to highlight the contents of a jupyter notebook cell.
```ipython
%%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:
```python
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()))
```
貢獻指南
這個儲存庫沒有索引到貢獻指南
評估
這個 Issue 還沒有評估資料。