diff --git a/app/assets/javascripts/discourse/dialects/code_dialect.js b/app/assets/javascripts/discourse/dialects/code_dialect.js index 2594cd831..9122abf6e 100644 --- a/app/assets/javascripts/discourse/dialects/code_dialect.js +++ b/app/assets/javascripts/discourse/dialects/code_dialect.js @@ -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,'')); } }); - diff --git a/app/assets/javascripts/discourse/dialects/table_dialect.js b/app/assets/javascripts/discourse/dialects/table_dialect.js index da9b2c2fc..4ddfd928b 100644 --- a/app/assets/javascripts/discourse/dialects/table_dialect.js +++ b/app/assets/javascripts/discourse/dialects/table_dialect.js @@ -49,4 +49,3 @@ if (Discourse.SiteSettings) { } else { Discourse.initializer({initialize: init, name: 'enable-html-tables'}); } - diff --git a/test/javascripts/lib/bbcode-test.js.es6 b/test/javascripts/lib/bbcode-test.js.es6 index c9b3ac3b7..ad26cc6c7 100644 --- a/test/javascripts/lib/bbcode-test.js.es6 +++ b/test/javascripts/lib/bbcode-test.js.es6 @@ -167,5 +167,3 @@ test("quotes with trailing formatting", function() { "
EvilTrout:

hello

\n\n

Test

", "it allows trailing formatting"); }); - -