telegramdesktop / tdesktop

Telegram Desktop messaging app
https://desktop.telegram.org/
Other
25.82k stars 5.11k forks source link

Telegram will treat “in”, "not" in python error exception as keyword #27173

Closed LaoshuBaby closed 9 months ago

LaoshuBaby commented 9 months ago

Steps to reproduce

Send this part of code

Note: I haven't pointed out which language should be used

  File "C:\Environment\Python311\Lib\site-packages\internetarchive\item.py", line 1119, in upload_file
    raise type(exc)(error_msg, response=exc.response, request=exc.request)
requests.exceptions.HTTPError:  error uploading BV1Jz4y1P7jY_p1-弹幕.ass to BiliBili-BV1Jz4y1P7jY_p1-Y2P4J1VB, The specified bucket is not valid. - Bucket names should be valid archive identifiers; try someting matching this regular expression: ^[a-zA-Z0-9][a-zA-Z0-9_.-]{4,100}$ (or, if you are making unusual identifiers, this user may lack the special permission to do so)

Expected behaviour

the in and out in exception string shouldn't be highlighted

Actual behaviour

图片

![图片](https://github.com/telegramdesktop/tdesktop/assets/42690037/d1341a52-47b0-433a-b883-5d4c1d06ddc0) ![图片](https://github.com/telegramdesktop/tdesktop/assets/42690037/1afec753-22f7-416f-8cc9-62d6981d0724) Infact, github's render also have some problem with highlight, it also treat "if not" as a keyword, but "try" and "or, if" are normal.

Operating system

Windows

Version of Telegram Desktop

4.11.7 x64

Installation source

Static binary from official website

Crash ID

No response

Logs

No response

ilya-fedin commented 9 months ago

The highlighting rules are from https://github.com/PrismJS/prism