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

Use the token type Comment, not Comment.Preproc, for RST comments #2598

Merged
merged 1 commit into from
Nov 28, 2023

Conversation

kurtmckee
Copy link
Contributor

While documenting a project that interacts with headers across different file formats, I noticed that RestructuredText comments rendered differently from the others:

image

For clarity: the difference between RestructuredText comments and other lexers' comments is that all other comments are styled as blue text and italicized, but RestructuredText uses green text and is un-italicized.

The root cause is that RestructuredText comments are given the token type Comment.Preproc, which is styled uniquely by most styles that I reviewed in Pygments.

This PR modifies the token type for RST comments to Comment. This results in rendering that matches my expectations:

image

Please let me know if anything is amiss here! As always, thanks for your work on Pygments!

@birkenfeld
Copy link
Member

Yeah, there's no good reason for this. Thanks!

@birkenfeld birkenfeld merged commit ea27d99 into pygments:master Nov 28, 2023
15 checks passed
@Anteru
Copy link
Collaborator

Anteru commented Nov 28, 2023

It's not a preprocessor anyways, so yes, this is the right change.

@Anteru
Copy link
Collaborator

Anteru commented Nov 28, 2023

Too slow this morning. More coffee needed apparently to beat @birkenfeld on the job :(

@Anteru Anteru added this to the 2.18.0 milestone Nov 28, 2023
@Anteru Anteru added A-lexing area: changes to individual lexers changelog-update Items which need to get mentioned in the changelog labels Nov 28, 2023
@jeanas jeanas removed the changelog-update Items which need to get mentioned in the changelog label Nov 28, 2023
@kurtmckee kurtmckee deleted the fix-rst-multiline-comments branch November 28, 2023 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lexing area: changes to individual lexers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants