From b27d7a76741a827cd791bb4dd3966946e2d87a3a Mon Sep 17 00:00:00 2001
From: Benjamin Young <byoung2@wiley.com>
Date: Tue, 11 Jul 2017 09:44:03 -0400
Subject: [PATCH] Add defineMIME for correct N-Triples

Also correct links to specification.
---
 mode/index.html           |  2 +-
 mode/ntriples/index.html  |  8 ++++----
 mode/ntriples/ntriples.js | 11 ++++++++---
 3 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/mode/index.html b/mode/index.html
index c0001a53e..53196b69b 100644
--- a/mode/index.html
+++ b/mode/index.html
@@ -93,7 +93,7 @@ option.</p>
       <li><a href="mumps/index.html">MUMPS</a></li>
       <li><a href="nginx/index.html">Nginx</a></li>
       <li><a href="nsis/index.html">NSIS</a></li>
-      <li><a href="ntriples/index.html">NTriples</a></li>
+      <li><a href="ntriples/index.html">N-Triples</a></li>
       <li><a href="clike/index.html">Objective C</a></li>
       <li><a href="mllike/index.html">OCaml</a></li>
       <li><a href="octave/index.html">Octave</a> (MATLAB)</li>
diff --git a/mode/ntriples/index.html b/mode/ntriples/index.html
index 1355e7189..378a0be29 100644
--- a/mode/ntriples/index.html
+++ b/mode/ntriples/index.html
@@ -1,6 +1,6 @@
 <!doctype html>
 
-<title>CodeMirror: NTriples mode</title>
+<title>CodeMirror: N-Triples mode</title>
 <meta charset="utf-8"/>
 <link rel=stylesheet href="../../doc/docs.css">
 
@@ -22,12 +22,12 @@
   </ul>
   <ul>
     <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">NTriples</a>
+    <li><a class=active href="#">N-Triples</a>
   </ul>
 </div>
 
 <article>
-<h2>NTriples mode</h2>
+  <h2><a href="https://www.w3.org/TR/n-triples/">N-Triples</a> mode</h2>
 <form>
 <textarea id="ntriples" name="ntriples">    
 <http://Sub1>     <http://pred1>     <http://obj> .
@@ -41,5 +41,5 @@ _:bnode5          <http://pred5>     "literal 3"^^<http://type> .
     <script>
       var editor = CodeMirror.fromTextArea(document.getElementById("ntriples"), {});
     </script>
-    <p><strong>MIME types defined:</strong> <code>text/n-triples</code>.</p>
+    <p><strong>MIME types defined:</strong> <code>application/n-triples</code>.</p>
   </article>
diff --git a/mode/ntriples/ntriples.js b/mode/ntriples/ntriples.js
index 0524b1e8a..765be0cfb 100644
--- a/mode/ntriples/ntriples.js
+++ b/mode/ntriples/ntriples.js
@@ -3,9 +3,9 @@
 
 /**********************************************************
 * This script provides syntax highlighting support for
-* the Ntriples format.
-* Ntriples format specification:
-*     http://www.w3.org/TR/rdf-testcases/#ntriples
+* the N-Triples format.
+* N-Triples format specification:
+*     https://www.w3.org/TR/n-triples/
 ***********************************************************/
 
 /*
@@ -181,6 +181,11 @@ CodeMirror.defineMode("ntriples", function() {
   };
 });
 
+// define the registered Media Type for n-triples:
+// https://www.w3.org/TR/n-triples/#n-triples-mediatype
+CodeMirror.defineMIME("application/n-triples", "ntriples");
+
+// previously used, though technically incorrect media type for n-triples
 CodeMirror.defineMIME("text/n-triples", "ntriples");
 
 });
-- 
GitLab