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

Comments not highlighted correctly in Makefiles #2055

Open
jwbargsten opened this issue Jun 16, 2024 · 0 comments
Open

Comments not highlighted correctly in Makefiles #2055

jwbargsten opened this issue Jun 16, 2024 · 0 comments
Labels
bugfix-request A request for a bugfix to be developed.

Comments

@jwbargsten
Copy link

Name of the lexer
make

Code sample

build: clean ## build the package
  python -m build

https://rouge.jneen.net/v4.3.0/make/YnVpbGQ6IGNsZWFuICMgYnVpbGQgdGhlIHBhY2thZ2UKCXB5dGhvbiAtbSBidWlsZAo

Additional context
In the make.rb lexer, the Comment rule in the state :block_header block should be greedy

--- lib/rouge/lexers/make.rb	2024-06-16 12:56:19.968821924 +0200
+++ lib/rouge/lexers/make.fixed.rb	2024-06-16 12:56:32.721847441 +0200
@@ -81,7 +81,7 @@
       state :block_header do
         rule %r/[^,\\\n#]+/, Name::Function
         rule %r/,/, Punctuation
-        rule %r/#.*?/, Comment
+        rule %r/#.*/, Comment
         rule %r/\\\n/, Text
         rule %r/\\./, Text
         rule %r/\n/ do
@jwbargsten jwbargsten added the bugfix-request A request for a bugfix to be developed. label Jun 16, 2024
@jwbargsten jwbargsten changed the title Make file does not highlight comments correctly Comments not highlighted correctly in Makefiles Jun 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix-request A request for a bugfix to be developed.
Projects
None yet
Development

No branches or pull requests

1 participant