-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds support for comments in JSON (#1595)
While JSON doesn't explicitly support comments, they're commonly used and there are supersets of JSON that do make comments available. PrismJS is not a linter, and this is a useful feature to include when displaying JSON.
- Loading branch information
1 parent
6d1a2c6
commit 8720b3e
Showing
3 changed files
with
33 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
// Line comment | ||
"//": "//", | ||
|
||
/* Block comment */ | ||
"/*": "*/" | ||
} | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["punctuation", "{"], | ||
["comment", "// Line comment"], | ||
["property", "\"//\""], | ||
["operator", ":"], | ||
["string", "\"//\""], | ||
["punctuation", ","], | ||
["comment", "/* Block comment */"], | ||
["property", "\"/*\""], | ||
["operator", ":"], | ||
["string", "\"*/\""], | ||
["punctuation", "}"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for single-line and multi-line comments. |