Skip to content

Commit

Permalink
Merge pull request #3209 from sharkdp/ndjson
Browse files Browse the repository at this point in the history
Add mapping for ndjson file extension to JSON syntax
  • Loading branch information
keith-hall authored Feb 15, 2025
2 parents 94d3dc2 + 2843a2c commit adfb951
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
- Add syntax mapping for `nix`'s '`flake.lock` lockfiles #3196 (@odilf)
- Improvements to CSV/TSV highlighting, with autodetection of delimiter and support for TSV files, see #3186 (@keith-
- Improve (Sys)log error highlighting, see #3205 (@keith-hall)
- Map `ndjson` extension to JSON syntax, see #3209 (@keith-hall)

## Themes

Expand Down
2 changes: 1 addition & 1 deletion src/syntax_mapping/builtins/common/50-json.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# JSON Lines is a simple variation of JSON #2535
[mappings]
"JSON" = ["*.jsonl", "*.jsonc", "*.jsonld", "*.geojson"]
"JSON" = ["*.jsonl", "*.jsonc", "*.jsonld", "*.geojson", "*.ndjson"]
3 changes: 3 additions & 0 deletions tests/syntax-tests/highlighted/JSON/example.ndjson
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{"some":"thing"}
{"foo":17,"bar":false,"quux":true}
{"may":{"include":"nested","objects":["and","arrays"]}}
3 changes: 3 additions & 0 deletions tests/syntax-tests/source/JSON/example.ndjson
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{"some":"thing"}
{"foo":17,"bar":false,"quux":true}
{"may":{"include":"nested","objects":["and","arrays"]}}

0 comments on commit adfb951

Please sign in to comment.