Skip to content

Commit 5ded76c

Browse files
authoredMay 19, 2017
Rollup merge of rust-lang#42096 - ollie27:rustdoc_js_impls, r=GuillaumeGomez
rustdoc: Fix implementors list javascript * Use a different loop variable, `i` was already taken. This caused missing items in the implementors list. * Use `.getAttribute('href')` rather than `.href` to get the relative URL which is what it needs to actually fix the links. More fallout from rust-lang#41307. r? @GuillaumeGomez
2 parents fd8ca3e + e48086c commit 5ded76c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎src/librustdoc/html/static/main.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1083,10 +1083,10 @@
10831083
code.innerHTML = structs[j];
10841084

10851085
var x = code.getElementsByTagName('a');
1086-
for (var i = 0; i < x.length; i++) {
1087-
var href = x[i].href;
1086+
for (var k = 0; k < x.length; k++) {
1087+
var href = x[k].getAttribute('href');
10881088
if (href && href.indexOf('http') !== 0) {
1089-
x[i].href = rootPath + href;
1089+
x[k].setAttribute('href', rootPath + href);
10901090
}
10911091
}
10921092
var li = document.createElement('li');

0 commit comments

Comments
 (0)
Please sign in to comment.