diff --git a/public/js/gogs.js b/public/js/gogs.js
index <HASH>..<HASH> 100644
--- a/public/js/gogs.js
+++ b/public/js/gogs.js
@@ -719,7 +719,7 @@ function initEditor() {
         var val = $editFilename.val(), m, mode, spec, extension, extWithDot, previewLink, dataUrl, apiCall;
         extension = extWithDot = "";
         if (m = /.+\.([^.]+)$/.exec(val)) {
-            extension = m[1];
+            extension = m[1].toLowerCase();
             extWithDot = "." + extension;
         }
public: makes CodeMirror mode by filename lookups case-insensitive (#<I>)

* updated the highlight.js plugin



* added some explicit mappings for syntax highlighting



* public: makes CodeMirror mode by filename extension lookup case-insensitive