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 Screenshot_2026-10-01_at_10.11.23 Screenshot_2026-10-01_at_10.11.32
UPPER.GLEAM Screenshot_2026-10-01_at_10.12.14 Screenshot_2026-10-01_at_10.12.18

How to set up and validate locally

  1. In any project in your GDK, add these sample files (download all as a zip):

  2. Open each file in the repository blob viewer.

  3. Check that it's highlighted with the right language. The language is in the data-lang attribute on the .line elements:

    File Before After
    HELLO_UPPER.4DM plaintext 4d
    lower.4dproject plaintext json
    UPPER.GLEAM plaintext gleam
    MAIN.TF terraform (server-side Rouge fallback) hcl
    hello.4dm, lower.gleam 4d, gleam unchanged
Edited by Jacques Erasmus

Merge request reports

Loading
Loading