Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

None highlighted incorrectly after from keyword in Python code #13

Closed
rdbende opened this issue Apr 7, 2023 · 4 comments
Closed

None highlighted incorrectly after from keyword in Python code #13

rdbende opened this issue Apr 7, 2023 · 4 comments

Comments

@rdbende
Copy link
Owner

rdbende commented Apr 7, 2023

@Moosems:

Paste the following:

from
None

None is highlighted as though it is an import

@rdbende:

When pasting this Pygments yields Token.Name.Builtin.Pseudo for None, even though it's Token.Keyword.Constant. Probably a bug there.

@Moosems:

Do you want to open an issue on pygments?

@rdbende
Copy link
Owner Author

rdbende commented Apr 7, 2023

Pygments thinks it's part of a raise Exception from None statement. It doesn't do it with other constants, like True.

@Moosems
Copy link
Collaborator

Moosems commented Apr 7, 2023

Bug to report to Pygments then?

@rdbende
Copy link
Owner Author

rdbende commented Apr 8, 2023

Pygments thinks it's part of a raise Exception from None statement. It doesn't do it with other constants, like True.

And I was right. Pull request opened: pygments/pygments#2406

@rdbende rdbende changed the title Paste can highlight incorrectly if newlines are used None highlighted incorrectly after from keyword in Python code Apr 8, 2023
@rdbende rdbende closed this as completed Apr 9, 2023
@Moosems
Copy link
Collaborator

Moosems commented Apr 9, 2023

@rdbende Thanks! Now we just have to wait for a new release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants