question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(properties) Keys with `.` in them are highlighted differently

See original GitHub issue

Describe 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 Firefox_Screenshot_2021-03-21T15-03-52 516Z

Expected behavior

listeners= should be rendered as advertised.listeners=

Additional context

Highlight.js 10.7.1 in Chrome with Github theme

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
egor-rogovcommented, Apr 3, 2021

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).

0reactions
gquintanacommented, Apr 5, 2021

Thank you @joshgoebel and @egor-rogov

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found