DEV: Modernise highlightjs loading (#24197)

- Remove vendored copy
- Update Rails implementation to look for language definitions in node_modules
- Use webpack-based dynamic import for hljs core
- Use browser-native dynamic import for site-specific language bundle (and fallback to webpack-based dynamic import in tests)
- Simplify markdown implementation to allow all languages into the `lang-{blah}` className
- Now that all languages are passed through, resolve aliases at runtime to avoid the need for the pre-built `highlightjs-aliases` index
This commit is contained in:
David Taylor
2023-11-10 20:39:48 +00:00
committed by GitHub
parent e845138bc1
commit 0878dde213
420 changed files with 168 additions and 40365 deletions
+2 -1
View File
@@ -34,7 +34,8 @@ RSpec.describe "CommonMark" do
cooked.gsub!(%r{<span class="hashtag-raw">(.*)</span>}, "\\1")
cooked.gsub!(%r{<a name="(.*)" class="anchor" href="#\1*"></a>}, "")
# we support data-attributes which is not in the spec
cooked.gsub!("<pre data-code-startline=\"3\">", "<pre>")
cooked.gsub!(" data-code-startline=\"3\"", "")
cooked.gsub!(%r{ data-code-wrap="[^"]+"}, "")
# we don't care about this
cooked.gsub!("<blockquote>\n</blockquote>", "<blockquote></blockquote>")
html.gsub!("<blockquote>\n</blockquote>", "<blockquote></blockquote>")