rouge-ruby / rouge

A pure Ruby code highlighter that is compatible with Pygments
https://rouge.jneen.net/
Other
3.3k stars 732 forks source link

toml: don't highlight keys with inline tables as tables #2002

Closed arp242 closed 7 months ago

arp242 commented 8 months ago

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.

arp242 commented 8 months ago

Example of the current behaviour (before this change):

cap-2023-10-12T08:51:53_border

That temp_targets highlighted the same as tables looks really off.

tancnle commented 7 months ago

Thank you for your contribution @arp242. LGTM 🚀