Skip to content

Fix language mapping in the Source Viewer

Jacques Erasmus requested to merge fix-language-map into master

What does this MR do and why?

We use Rouge to detect a language of a file, and then we map the language to a Highlight.js language definition. In some cases it seems like Rouge starts the language with an uppercase (Python vs python) which will break our Rouge -> HLJS language mapping. This fixes the language mapping in the Source Viewer by converting the language to lowercase during mapping.

Screenshots or screen recordings

Screenshot_2022-08-24_at_11.19.49

How to set up and validate locally

Open a source file from the repository files browser

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Jacques Erasmus

Merge request reports