Sublime Forum

JSON Invalid Syntax Highlighting because of 'Literal String'?

#1

Essentially doing just “String” is fine, but ‘Doing using this causes pink/red invalid syntax highlighting’.

0 Likes

#2

JSON strings are double-quoted. You’re trying to single-quote a string, which is not valid JSON. The core JSON syntax marks an incorrectly quoted string as an error.

0 Likes

#3

I see, even though JSON’s C# Extension works fine with single quotes?

0 Likes

#4

It sounds like you’re using a tool that accepts some other format that’s a superset of JSON. That format may have highlighting available; or, if it’s a subset of YAML, you could try that syntax.

0 Likes

#5

Nope its just JSON, I guess the C# library just detects ’ anyway.

0 Likes

#6

It looks like it’s JSON5, not JSON.

3 Likes