From 2b8b8e72e70b6e8e4205be3f35a8b9a50983595b Mon Sep 17 00:00:00 2001
From: Benjamin Young <byoung2@wiley.com>
Date: Fri, 28 Jul 2017 11:27:27 -0400
Subject: [PATCH] Add alternate media type for Shell

Seems Apache has its own list for non-registered
media types.
---
 mode/meta.js          | 2 +-
 mode/shell/index.html | 2 +-
 mode/shell/shell.js   | 3 +++
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/mode/meta.js b/mode/meta.js
index edaae033e..20973ace3 100644
--- a/mode/meta.js
+++ b/mode/meta.js
@@ -121,7 +121,7 @@
     {name: "Scala", mime: "text/x-scala", mode: "clike", ext: ["scala"]},
     {name: "Scheme", mime: "text/x-scheme", mode: "scheme", ext: ["scm", "ss"]},
     {name: "SCSS", mime: "text/x-scss", mode: "css", ext: ["scss"]},
-    {name: "Shell", mime: "text/x-sh", mode: "shell", ext: ["sh", "ksh", "bash"], alias: ["bash", "sh", "zsh"], file: /^PKGBUILD$/},
+    {name: "Shell", mimes: ["text/x-sh", "application/x-sh"], mode: "shell", ext: ["sh", "ksh", "bash"], alias: ["bash", "sh", "zsh"], file: /^PKGBUILD$/},
     {name: "Sieve", mime: "application/sieve", mode: "sieve", ext: ["siv", "sieve"]},
     {name: "Slim", mimes: ["text/x-slim", "application/x-slim"], mode: "slim", ext: ["slim"]},
     {name: "Smalltalk", mime: "text/x-stsrc", mode: "smalltalk", ext: ["st"]},
diff --git a/mode/shell/index.html b/mode/shell/index.html
index 0b56300b1..e42f4b5f3 100644
--- a/mode/shell/index.html
+++ b/mode/shell/index.html
@@ -62,5 +62,5 @@ exit 0</textarea>
   });
 </script>
 
-<p><strong>MIME types defined:</strong> <code>text/x-sh</code>.</p>
+<p><strong>MIME types defined:</strong> <code>text/x-sh</code>, <code>application/x-sh</code>.</p>
 </article>
diff --git a/mode/shell/shell.js b/mode/shell/shell.js
index 6af814c43..c5619afe7 100644
--- a/mode/shell/shell.js
+++ b/mode/shell/shell.js
@@ -135,5 +135,8 @@ CodeMirror.defineMode('shell', function() {
 });
 
 CodeMirror.defineMIME('text/x-sh', 'shell');
+// Apache uses a slightly different Media Type for Shell scripts
+// http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
+CodeMirror.defineMIME('application/x-sh', 'shell');
 
 });
-- 
GitLab