mirror of
https://github.com/discourse/discourse.git
synced 2026-08-11 13:35:20 -05:00
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:
@@ -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>")
|
||||
|
||||
Reference in New Issue
Block a user