Skip to content

Commit 72b7c8d

Browse files
Remove extra span tags
1 parent 9483e9b commit 72b7c8d

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/librustdoc/html/static/main.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@
5757
return this.indexOf(searchString, position) === position;
5858
};
5959
}
60+
if (!String.prototype.endsWith) {
61+
String.prototype.endsWith = function(suffix, length) {
62+
var l = length || this.length;
63+
return this.indexOf(suffix, l - suffix.length) !== -1;
64+
};
65+
}
6066

6167
function getPageId() {
6268
var id = document.location.href.split('#')[1];
@@ -1234,7 +1240,11 @@
12341240
}
12351241

12361242
function pathSplitter(path) {
1237-
return '<span>' + path.replace(/::/g, '::</span><span>');
1243+
var tmp = '<span>' + path.replace(/::/g, '::</span><span>');
1244+
if (tmp.endsWith("<span>")) {
1245+
return tmp.slice(0, tmp.length - 6);
1246+
}
1247+
return tmp;
12381248
}
12391249

12401250
function addTab(array, query, display) {

0 commit comments

Comments
 (0)