Commit ad37cba5 authored by Stefan Behnel's avatar Stefan Behnel

Only overwrite the href on legacy docs redirects, not the complete URL.

parent c9c2ee2f
...@@ -459,22 +459,14 @@ pdf_fit_background_mode = 'scale' ...@@ -459,22 +459,14 @@ pdf_fit_background_mode = 'scale'
# Making redirection: # Making redirection:
html_template = """ html_template = """\
<html> <html>
<head> <head>
<script> <script>
// Redirect to the new-style URL // Redirect to the new-style URL, but keep any #anchor etc.
var new_location = '{0}' window.location.href = '{0}';
// Some browsers include the hash character in the anchor, strip it out
const anchor = window.location.hash.replace(/^#(.*)/, '$1');
if (anchor){{
new_location += '#' + anchor;
}}
window.location = new_location
</script> </script>
<meta http-equiv="refresh" content="1; url={0}:" /> <meta http-equiv="refresh" content="1; url={0}" />
</head> </head>
</html> </html>
""" """
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment