FIX: Our test build of highlight.js was broken

FIX: Our test build of highlight.js was broken

Some definitions rely on others, in particular the c/cpp/c-like ones, and we were appending the bundle of all files in the folder.

Instead for testing I’ve limited us to just three definitions. This has the benefit of being a lot smaller to download/parse in test mode too.

diff --git a/lib/tasks/javascript.rake b/lib/tasks/javascript.rake
index 0cdab7a..c7c7452 100644
--- a/lib/tasks/javascript.rake
+++ b/lib/tasks/javascript.rake
@@ -193,7 +193,9 @@ task 'javascript:update' do
       system("rm -rf node_modules/highlight.js/build/styles")
 
       langs_dir = 'vendor/assets/javascripts/highlightjs/languages/*.min.js'
-      langs = Dir.glob(langs_dir).map { |lang| File.basename(lang).split('.')[0] }
+
+      # We don't need every language for tests
+      langs = ['javascript', 'sql', 'ruby']
       test_bundle_dest = 'vendor/assets/javascripts/highlightjs/highlight-test-bundle.min.js'
       File.write(test_bundle_dest, HighlightJs.bundle(langs))
     end
diff --git a/vendor/assets/javascripts/highlightjs/highlight-test-bundle.min.js b/vendor/assets/javascripts/highlightjs/highlight-test-bundle.min.js
index 4371efe..34fb0a6 100644
--- a/vendor/assets/javascripts/highlightjs/highlight-test-bundle.min.js
+++ b/vendor/assets/javascripts/highlightjs/highlight-test-bundle.min.js
@@ -1,194 +1,5 @@
 /*! highlight.js v9.18.1 | BSD3 License | git.io/hljslicense */

[... diff too long, it was truncated ...]

GitHub sha: 5e5973ca

1 Like