We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 957c28f commit 70ea430Copy full SHA for 70ea430
bin/source-highlight
@@ -17,14 +17,11 @@ if (sPos == -1 || sPos == process.argv.length - 1) {
17
process.exit(1);
18
}
19
var lang = process.argv[sPos + 1].toLowerCase(), modeName = lang;
20
-CodeMirror.modeInfo.forEach(function(info) {
21
- if (info.mime == lang) {
22
- modeName = info.mode;
23
- } else if (info.name.toLowerCase() == lang) {
24
25
- lang = info.mime;
26
- }
27
-});
+var found = CodeMirror.findModeByMIME(lang) || CodeMirror.findModeByName(lang)
+if (found) {
+ modeName = found.mode
+ lang = found.mime
+}
28
29
if (!CodeMirror.modes[modeName])
30
require("../mode/" + modeName + "/" + modeName + ".js");
0 commit comments