diff --git a/app/assets/javascripts/discourse/dialects/github_code_dialect.js b/app/assets/javascripts/discourse/dialects/github_code_dialect.js index 31fc8d97bfa..c4f38f814a9 100644 --- a/app/assets/javascripts/discourse/dialects/github_code_dialect.js +++ b/app/assets/javascripts/discourse/dialects/github_code_dialect.js @@ -19,7 +19,7 @@ Discourse.Dialect.replaceBlock({ stop: '```', emitter: function(blockContents, matches) { - var klass = 'lang-auto'; + var klass = Discourse.SiteSettings.default_code_lang; if (matches[1] && acceptableCodeClasses.indexOf(matches[1]) !== -1) { klass = matches[1]; } diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index a5ae2b3feaf..de9d54678a0 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -738,6 +738,7 @@ en: display_name_on_posts: "Also show a user's full name on their posts" invites_shown: "Maximum invites shown on a user page" short_progress_text_threshold: "After the number of posts in a topic goes above this number, the progress bar will only show the current post number. If you change the progress bar's width, you may need to change this value." + default_code_lang: "Default programming language syntax highlighting applied to GitHub code blocks (lang-auto, ruby, python etc.)" notification_types: mentioned: "%{display_username} mentioned you in %{link}" diff --git a/config/site_settings.yml b/config/site_settings.yml index b8915bd933e..4b1bbe40cb4 100644 --- a/config/site_settings.yml +++ b/config/site_settings.yml @@ -200,6 +200,9 @@ posting: short_progress_text_threshold: client: true default: 1000 + default_code_lang: + client: true + default: "lang-auto" email: email_time_window_mins: 10