rouge
rouge copied to clipboard
Comments not highlighted correctly in Makefiles
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