You might be surprised to learn that VS Code renders its viewport with HTML and it has no issues displaying this file.
This is also one of the use-cases I built the Tachi Code browser extension for. It injects a monaco-based editor into the current page when it detects you're viewing a raw file (i.e., the page's rendered body contains nothing other than a <pre> tag).
Tachi Code for Chrome: https://chromewebstore.google.com/detail/tachi-code/acoecgia...
Tachi Code for Firefox: https://addons.mozilla.org/en-US/firefox/addon/tachi-code/
GitHub is not VS Code. GitHub is a Ruby on Rails website with some React sprinkled on. You can't expect the same performance optimization from a website that a whole IDE has.