Rewrite #nXXX to #LXXX in incoming gitea urls

We can't rewrite hashes with mod_rewrite, as they are client-side
and are not sent to the server. Instead, put in a javascript snippet
to rewrite them in the format that gitea is looking for.

We only need to handle single lines, as cgit doesn't handle ranges.

Change-Id: I6226e420838a88276a86e406c40f6707eb090310
This commit is contained in:
Monty Taylor 2019-02-07 00:46:57 +00:00
parent 40cc016ce2
commit fe078ed994
1 changed files with 3 additions and 0 deletions

View File

@ -1,4 +1,7 @@
<div class="header-wrapper">
<script>
window.location.hash.replace(/#n(\d*)/, '#L$1');
</script>
{{with .Repository}}
<div class="ui container">
<div class="ui stackable grid header-grid">