From 92e91620bd4cc32e86534584598a526133f2eb9e Mon Sep 17 00:00:00 2001 From: Martin Tournoij Date: Thu, 12 Oct 2023 08:47:26 +0100 Subject: [PATCH] toml: don't highlight keys with inline tables as tables A TOML table looks like: [tblname] key = 'value' You can also use inline tables like so: [tblname] key = 'value' inline = {key = 'value'} However, the "inline" would get highlighted as a table (same as "[tblname]") rather than a regular key, which is very jarring and unexpected IMHO. It looks like it's been like this ever since inline tables were added in #1359, but I don't think anyone really wants this behaviour. --- lib/rouge/lexers/toml.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rouge/lexers/toml.rb b/lib/rouge/lexers/toml.rb index 2a54c58afc..23ec389acf 100644 --- a/lib/rouge/lexers/toml.rb +++ b/lib/rouge/lexers/toml.rb @@ -20,7 +20,7 @@ class TOML < RegexLexer rule %r/(true|false)/, Keyword::Constant rule %r/(#{identifier})(\s*)(=)(\s*)(\{)/ do - groups Name::Namespace, Text, Operator, Text, Punctuation + groups Name::Property, Text, Operator, Text, Punctuation push :inline end