mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-17 19:12:37 -05:00
FIX: handle topic/post creation when the language highlighting is turned off
This commit is contained in:
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,''));
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -49,4 +49,3 @@ if (Discourse.SiteSettings) {
|
|||
} else {
|
||||
Discourse.initializer({initialize: init, name: 'enable-html-tables'});
|
||||
}
|
||||
|
||||
|
|
|
@ -167,5 +167,3 @@ test("quotes with trailing formatting", function() {
|
|||
"<div class=\"quote-controls\"></div>EvilTrout:</div><blockquote><p>hello</p></blockquote></aside>\n\n<p><em>Test</em></p>",
|
||||
"it allows trailing formatting");
|
||||
});
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue