We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents e579a5d + 2b07ff3 commit 59b32ffCopy full SHA for 59b32ff
1 file changed
gitweb/static/js/javascript-detection.js
@@ -16,7 +16,7 @@
16
* and other reasons to not add 'js=1' param at the end of link
17
* @constant
18
*/
19
-var jsExceptionsRe = /[;?]js=[01]$/;
+var jsExceptionsRe = /[;?]js=[01](#.*)?$/;
20
21
/**
22
* Add '?js=1' or ';js=1' to the end of every link in the document
@@ -33,9 +33,9 @@ function fixLinks() {
33
var allLinks = document.getElementsByTagName("a") || document.links;
34
for (var i = 0, len = allLinks.length; i < len; i++) {
35
var link = allLinks[i];
36
- if (!jsExceptionsRe.test(link)) { // =~ /[;?]js=[01]$/;
37
- link.href +=
38
- (link.href.indexOf('?') === -1 ? '?' : ';') + 'js=1';
+ if (!jsExceptionsRe.test(link)) {
+ link.href = link.href.replace(/(#|$)/,
+ (link.href.indexOf('?') === -1 ? '?' : ';') + 'js=1$1');
39
}
40
41
0 commit comments