Fix lack of CoffeeScript livepreview
Pygments calls it coffeescript, but Ace calls it coffee.
This commit is contained in:
@@ -195,12 +195,13 @@ var previewSet = function( text ) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// 'c', 'c++', 'cpp' are github specific and transformed to c_cpp for Ace.
|
// 'c', 'c++', 'cpp' are github specific and transformed to c_cpp for Ace.
|
||||||
var languages = [ 'c', 'c++', 'cpp', 'clojure', 'coffee', 'coldfusion',
|
// 'coffeescript' is transformed to 'coffee' for Ace.
|
||||||
'csharp', 'css', 'diff', 'golang', 'groovy', 'haxe', 'html',
|
var languages = [ 'c', 'c++', 'cpp', 'clojure', 'coffee',
|
||||||
'java', 'javascript', 'json', 'latex', 'less', 'liquid',
|
'coffeescript', 'coldfusion', 'csharp', 'css', 'diff', 'golang',
|
||||||
'lua', 'markdown', 'ocaml', 'perl', 'pgsql', 'php', 'powershell',
|
'groovy', 'haxe', 'html', 'java', 'javascript', 'json', 'latex',
|
||||||
'python', 'ruby', 'scad', 'scala', 'scss', 'sh', 'sql', 'svg',
|
'less', 'liquid', 'lua', 'markdown', 'ocaml', 'perl', 'pgsql', 'php',
|
||||||
'textile', 'text', 'xml', 'xquery', 'yaml' ];
|
'powershell', 'python', 'ruby', 'scad', 'scala', 'scss', 'sh', 'sql',
|
||||||
|
'svg', 'textile', 'text', 'xml', 'xquery', 'yaml' ];
|
||||||
|
|
||||||
var staticHighlight = require( 'ace/ext/static_highlight' );
|
var staticHighlight = require( 'ace/ext/static_highlight' );
|
||||||
var githubTheme = require( 'ace/theme/github' );
|
var githubTheme = require( 'ace/theme/github' );
|
||||||
@@ -303,6 +304,12 @@ var makePreviewHtml = function () {
|
|||||||
aceMode = 'c_cpp';
|
aceMode = 'c_cpp';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Pygments's name for CoffeeScript is 'coffeescript', but Ace
|
||||||
|
// calls it 'coffee'.
|
||||||
|
if ( declaredLanguage === 'coffeescript' ) {
|
||||||
|
aceMode = 'coffee';
|
||||||
|
}
|
||||||
|
|
||||||
if ( $.inArray( declaredLanguage, languages ) === -1 ) {
|
if ( $.inArray( declaredLanguage, languages ) === -1 ) {
|
||||||
// Unsupported language.
|
// Unsupported language.
|
||||||
skipped++;
|
skipped++;
|
||||||
|
|||||||
Reference in New Issue
Block a user