|
|
|
@ -154,10 +154,15 @@ define([
|
|
|
|
|
var setMode = exp.setMode = function (mode, cb) {
|
|
|
|
|
exp.highlightMode = mode;
|
|
|
|
|
if (mode === 'markdown') { mode = 'gfm'; }
|
|
|
|
|
if (mode !== "text") {
|
|
|
|
|
CMeditor.autoLoadMode(editor, mode);
|
|
|
|
|
if (/text\/x/.test(mode)) {
|
|
|
|
|
CMeditor.autoLoadMode(editor, 'clike');
|
|
|
|
|
editor.setOption('mode', mode);
|
|
|
|
|
} else {
|
|
|
|
|
if (mode !== "text") {
|
|
|
|
|
CMeditor.autoLoadMode(editor, mode);
|
|
|
|
|
}
|
|
|
|
|
editor.setOption('mode', mode);
|
|
|
|
|
}
|
|
|
|
|
editor.setOption('mode', mode);
|
|
|
|
|
if (exp.$language) {
|
|
|
|
|
var name = exp.$language.find('a[data-value="' + mode + '"]').text() || undefined;
|
|
|
|
|
name = name ? Messages.languageButton + ' ('+name+')' : Messages.languageButton;
|
|
|
|
|