(properties) Keys with `.` in them are highlighted differently
See original GitHub issueDescribe the issue
When the key part doesn’t contain a dot it’s rendered as other properties
Which language seems to have the issue?
Properties
Are you using highlight
or highlightAuto
?
I don’t know, I am using @asciidoc/reveal
Sample Code to Reproduce
listeners=CLIENT://192.168.0.1:9092,CLUSTER://192.168.3.1:9093
advertised.listeners=CLIENT://public:9092,CLUSTER://private:9093
listener.security.protocol.map=CLIENT:PLAINTEXT,CLUSTER:PLAINTEXT
inter.broker.listener.name=CLUSTER
is rendered as
Expected behavior
listeners=
should be rendered as advertised.listeners=
Additional context
Highlight.js 10.7.1 in Chrome with Github theme
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Different colors for Keys and Values for JSON? - Stack Overflow
Because both keys and values are usually strings in JSON (not in javascript objects though), there's no way to highlight them differently.
Read more >keys of JS Object show in different color? : WEB-22529
WEB-43795 Keys should be different shade of green compared to values. 1. Is it possible to have this colorize the property names in...
Read more >Layers | Style Specification | Mapbox GL JS
A style's layers property lists all the layers available in that style. The type of layer is specified by the "type" property, and...
Read more >5 Ways to Highlight Every Rental Property's Sellable Features
Every property is different—and each one has features that make it stand out from the rest of the rental opportunities nearby.
Read more >Syntax Highlight Guide | Visual Studio Code Extension API
It is responsible for colorizing keywords like if or for in JavaScript differently than strings and comments and variable names. There are two...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Looks like there are no any restrictions, you can use whatever characters you like for keys. No special cases, dot is just like any other character. I think my thoughts were like this: “in all examples of .properties files I’ve ever seen the keys were alphanumeric; so if we encounter something strange (@#$ = foo) we’d better use zero relevance”. And then I made this special case and somehow managed to use different class name for it. It’s a 100% bug. I’ve just checked: it’s OK to flatten he grammar to just keys (making no distinction for character classes).
Thank you @joshgoebel and @egor-rogov