FIX: empty highlighted_languages resulted in ["", "auto", "nohighlight"] (#10772)

FIX: empty highlighted_languages resulted in ["", “auto”, “nohighlight”] (#10772)

diff --git a/app/assets/javascripts/pretty-text/engines/discourse-markdown/code.js b/app/assets/javascripts/pretty-text/engines/discourse-markdown/code.js
index 6f7535d..8837b5d 100644
--- a/app/assets/javascripts/pretty-text/engines/discourse-markdown/code.js
+++ b/app/assets/javascripts/pretty-text/engines/discourse-markdown/code.js
@@ -37,6 +37,7 @@ export function setup(helper) {
     opts.defaultCodeLang = siteSettings.default_code_lang;
     opts.acceptableCodeClasses = (siteSettings.highlighted_languages || "")
       .split("|")
+      .filter(Boolean)
       .concat(["auto", "nohighlight"]);
   });
 

GitHub sha: de94506c

1 Like

This commit appears in #10772 which was approved by SamSaffron and CvX. It was merged by jjaffeux.