From 5738f9b2cff5241ea13e32db3579eb347e56e7a0 Mon Sep 17 00:00:00 2001
From: Timothy Hatcher <timothy@apple.com>
Date: Fri, 12 Aug 2016 17:30:55 -0700
Subject: [PATCH] Special case JSON based MIME-types.

Fixes issue #4163.
---
 lib/codemirror.js | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/codemirror.js b/lib/codemirror.js
index d08aa67f6..65bfc7999 100644
--- a/lib/codemirror.js
+++ b/lib/codemirror.js
@@ -5533,6 +5533,8 @@
       spec.name = found.name;
     } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(spec)) {
       return CodeMirror.resolveMode("application/xml");
+    } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+json$/.test(spec)) {
+      return CodeMirror.resolveMode("application/json");
     }
     if (typeof spec == "string") return {name: spec};
     else return spec || {name: "null"};
-- 
GitLab