diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b07bd58..6859f71a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/syntax_mapping/builtins/common/50-json.toml b/src/syntax_mapping/builtins/common/50-json.toml index 3198c4f3..6b3252e8 100644 --- a/src/syntax_mapping/builtins/common/50-json.toml +++ b/src/syntax_mapping/builtins/common/50-json.toml @@ -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"] diff --git a/tests/syntax-tests/highlighted/JSON/example.ndjson b/tests/syntax-tests/highlighted/JSON/example.ndjson new file mode 100644 index 00000000..775a5218 --- /dev/null +++ b/tests/syntax-tests/highlighted/JSON/example.ndjson @@ -0,0 +1,3 @@ +{"some":"thing"} +{"foo":17,"bar":false,"quux":true} +{"may":{"include":"nested","objects":["and","arrays"]}} diff --git a/tests/syntax-tests/source/JSON/example.ndjson b/tests/syntax-tests/source/JSON/example.ndjson new file mode 100644 index 00000000..2bc459eb --- /dev/null +++ b/tests/syntax-tests/source/JSON/example.ndjson @@ -0,0 +1,3 @@ +{"some":"thing"} +{"foo":17,"bar":false,"quux":true} +{"may":{"include":"nested","objects":["and","arrays"]}}