ipython / ipython/ipython-pygments-lexers
failure on shell commands after `%%time`
- 主要言語
- Python
- スター
- 0
- フォーク
- 2
- 平均マージ
- 12日 21時間
- マージ済み PR(30日)
- 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 はまだ評価されていません。