Repository: sharkdp/bat (language: rust)

Issue:
Support ndjson
Please support ndjson. jq i.e. already outputs highlighted ndjson, while bat doesn't.


**Syntax:**

- https://github.com/ndjson/ndjson-spec

**Guideline Criteria:**





Discussion / hints:

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1b07bd587e..6859f71a56 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 3198c4f347..6b3252e819 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"]


Test patch:
diff --git a/tests/syntax-tests/highlighted/JSON/example.ndjson b/tests/syntax-tests/highlighted/JSON/example.ndjson
new file mode 100644
index 0000000000..775a521843
--- /dev/null
+++ b/tests/syntax-tests/highlighted/JSON/example.ndjson
@@ -0,0 +1,3 @@
+[38;2;248;248;242m{[0m[38;2;253;151;31m"[0m[38;2;253;151;31msome[0m[38;2;253;151;31m"[0m[38;2;248;248;242m:[0m[38;2;230;219;116m"[0m[38;2;230;219;116mthing[0m[38;2;230;219;116m"[0m[38;2;248;248;242m}[0m
+[38;2;248;248;242m{[0m[38;2;253;151;31m"[0m[38;2;253;151;31mfoo[0m[38;2;253;151;31m"[0m[38;2;248;248;242m:[0m[38;2;190;132;255m17[0m[38;2;248;248;242m,[0m[38;2;253;151;31m"[0m[38;2;253;151;31mbar[0m[38;2;253;151;31m"[0m[38;2;248;248;242m:[0m[38;2;190;132;255mfalse[0m[38;2;248;248;242m,[0m[38;2;253;151;31m"[0m[38;2;253;151;31mquux[0m[38;2;253;151;31m"[0m[38;2;248;248;242m:[0m[38;2;190;132;255mtrue[0m[38;2;248;248;242m}[0m
+[38;2;248;248;242m{[0m[38;2;253;151;31m"[0m[38;2;253;151;31mmay[0m[38;2;253;151;31m"[0m[38;2;248;248;242m:[0m[38;2;248;248;242m{[0m[38;2;253;151;31m"[0m[38;2;253;151;31minclude[0m[38;2;253;151;31m"[0m[38;2;248;248;242m:[0m[38;2;230;219;116m"[0m[38;2;230;219;116mnested[0m[38;2;230;219;116m"[0m[38;2;248;248;242m,[0m[38;2;253;151;31m"[0m[38;2;253;151;31mobjects[0m[38;2;253;151;31m"[0m[38;2;248;248;242m:[0m[38;2;248;248;242m[[0m[38;2;230;219;116m"[0m[38;2;230;219;116mand[0m[38;2;230;219;116m"[0m[38;2;248;248;242m,[0m[38;2;230;219;116m"[0m[38;2;230;219;116marrays[0m[38;2;230;219;116m"[0m[38;2;248;248;242m][0m[38;2;248;248;242m}[0m[38;2;248;248;242m}[0m
diff --git a/tests/syntax-tests/source/JSON/example.ndjson b/tests/syntax-tests/source/JSON/example.ndjson
new file mode 100644
index 0000000000..2bc459eb96
--- /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"]}}