Autoscrolling to hashtags on jobs output page does not work

Summary

Autoscrolling to hashtags on jobs output page does not work. Using the following real example:

https://gitlab.com/wichers/benchmark/-/jobs/478537875#L51

There are two issues.

  1. When you simply past this link into your browser, you end up at the bottom of the page, not line 51.
  2. If you are looking that page, and click on a line (like 51 above), that line actually scrolls off above the visible window slightly so you can't actually see it (which is annoying).

Being able to send people links with line #'s like this has been very useful in my experience so getting this to work right would be good.

Steps to reproduce

  1. Paste this link into your browser: https://gitlab.com/wichers/benchmark/-/jobs/478537875#L51 and notice you don't go to that line.
  2. Click on that line in your browser and notice it scroll off above the current window.

What is the current bug behavior?

Described in summary.

What is the expected correct behavior?

In both cases, you should autoscroll to that line and that line should be visible in the current window.

Output of checks

This bug happens on GitLab.com