Loading
Make highlight.js extension matching case-insensitive
What does this MR do and why?
The repository blob viewer ignored the highlight.js language overrides in FILE_EXTENSION_MAPPING_HLJS when the file name's casing differed from the map key. So UPPER.GLEAM and HELLO_UPPER.4DM showed as plain text, while lower.gleam was highlighted.
This MR lowercases both the file name and the extension before comparing them. That matches Rouge's own filename detection, which already ignores case.
References
Screenshots or screen recordings
| File | Before | After |
|---|---|---|
HELLO_UPPER.4DM |
![]() |
![]() |
UPPER.GLEAM |
![]() |
![]() |
How to set up and validate locally
-
In any project in your GDK, add these sample files (download all as a zip):
- HELLO_UPPER.4DM
- lower.4dproject
- UPPER.GLEAM
- MAIN.TF
- hello.4dm and lower.gleam (controls that were already highlighted)
-
Open each file in the repository blob viewer.
-
Check that it's highlighted with the right language. The language is in the
data-langattribute on the.lineelements:File Before After HELLO_UPPER.4DMplaintext4dlower.4dprojectplaintextjsonUPPER.GLEAMplaintextgleamMAIN.TFterraform(server-side Rouge fallback)hclhello.4dm,lower.gleam4d,gleamunchanged
Edited by Jacques Erasmus



