FIX: handle topic/post creation when the language highlighting is turned off

This commit is contained in:
Arpit Jalan
2015-11-21 00:50:44 +05:30
parent 1bf2b236cb
commit e25ee74209
3 changed files with 2 additions and 6 deletions
@@ -12,7 +12,7 @@ function init() {
}
}
if (Discourse.SiteSettings && Discourse.SiteSettings.highlighted_languages) {
if (Discourse.SiteSettings) {
init();
} else {
Discourse.initializer({initialize: init, name: 'load-acceptable-code-classes'});
@@ -38,7 +38,7 @@ Discourse.Dialect.replaceBlock({
var klass = Discourse.SiteSettings.default_code_lang;
if (matches[1] && acceptableCodeClasses.indexOf(matches[1]) !== -1) {
if (acceptableCodeClasses && matches[1] && acceptableCodeClasses.indexOf(matches[1]) !== -1) {
klass = matches[1];
}
@@ -79,4 +79,3 @@ Discourse.Dialect.on('parseNode', function (event) {
node[node.length-1] = Handlebars.Utils.escapeExpression(contents.replace(regexp,''));
}
});