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

SystemdLexer and DesktopLexer #2470

Merged
merged 2 commits into from
Jul 9, 2023
Merged

Conversation

randomstuff
Copy link
Contributor

This implements more precise rules for systemd unit and .desktop files. For example, this fixes entries such as:

Categories=System;TerminalEmulator;
MimeType=image/*;application/x-sh;application/x-shellscript;inode/directory;text/*;x-scheme-handler/kitty;

which were considered to contain a trailing comment.

Copy link
Member

@birkenfeld birkenfeld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Generally a good idea, and can be extended later e.g. recognizing systemd's quoting and escaping mechanisms. Just a few nits...

pygments/lexers/configs.py Outdated Show resolved Hide resolved
pygments/lexers/configs.py Outdated Show resolved Hide resolved
pygments/lexers/configs.py Outdated Show resolved Hide resolved
pygments/lexers/configs.py Outdated Show resolved Hide resolved
@randomstuff
Copy link
Contributor Author

Added support for .desktop language tags. Currently I'm (ab)using Name.Namespace.

I see that TurtleLexer uses Generic.Emph for a similar usage ("..."@en) which is not really better.

@birkenfeld birkenfeld added the changelog-update Items which need to get mentioned in the changelog label Jul 9, 2023
@birkenfeld
Copy link
Member

LGTM. Thanks!

@birkenfeld birkenfeld merged commit 3c7fbf8 into pygments:master Jul 9, 2023
@Anteru Anteru removed the changelog-update Items which need to get mentioned in the changelog label Aug 5, 2023
@Anteru Anteru added this to the 2.16.0 milestone Aug 5, 2023
@Anteru Anteru added the A-lexing area: changes to individual lexers label Aug 5, 2023
@randomstuff randomstuff deleted the systemd branch August 7, 2023 17:03
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.

3 participants