ipython / ipython/ipython-pygments-lexers

failure on shell commands after `%%time`

オープン
#11 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
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 はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。