Browse Source

Complete prelude, and lint

Soreine 7 years ago
parent
commit
f1a3d13dd5
1 changed files with 8 additions and 4 deletions
  1. 8 4
      index.js

+ 8 - 4
index.js

@@ -14,16 +14,20 @@ var MAP_LANGUAGES = {
   'html': 'markup'
 };
 
-// Base languages syntaxes, extended by other syntaxes, need to be
-// required before all.
-var PRELUDE = ['clike', 'javascript', 'markup', 'c', 'ruby', 'css'];
+// Base languages syntaxes (as of prism@1.6.0), extended by other syntaxes.
+// They need to be required before the others.
+var PRELUDE = [
+  'clike', 'javascript', 'markup', 'c', 'ruby', 'css', 'previewer-base', 'toolbar',
+  // The following depends on previous ones
+  'java', 'php'
+];
 PRELUDE.map(requireSyntax);
 
 /**
  * Load the syntax definition for a language id
  */
 function requireSyntax(lang) {
-    require('prismjs/components/prism-' + lang + '.js');
+  require('prismjs/components/prism-' + lang + '.js');
 }
 
 function getAssets() {