flawiddsouza / Restfox

Offline-First Minimalistic HTTP & Socket Testing Client for the Web & Desktop
https://restfox.dev
MIT License
1.96k stars 97 forks source link

Incorrect JSON syntax highlighting following non-quoted environment variable #228

Open salittle0 opened 3 weeks ago

salittle0 commented 3 weeks ago

The JSON syntax highlighting breaks after a line that includes a non-quoted environment variable (e.g. a bool/number). Using a misc. JSON body as an example: image

You can see the highlighting is fine for non-environment variables, and for an environment variable that is contained within quotes, but fails after {{env_num}} where it highlights the key of the following line. The same behaviour occurs for bool/null.

flawiddsouza commented 3 weeks ago

I don't think it's possible to get code mirror to treat the json as valid without the quotes. Not sure if we can fix this without writing a custom syntax highlighter for this.

The same behaviour occurs for bool/null

That doesn't sound right. Highlighting seems correct in above screenshot after bool / null. As it's valid json.

salittle0 commented 2 weeks ago

Sorry, confusing wording. I meant the same occurs for environment variables that are boolean/null, which is exactly what I'd expect.

I figured it might be wrapped up in another package—I guess you could call it a feature request then, but I don't think it's all that important.