Skip to content

Commit

Permalink
Remove extra span tags
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed May 12, 2018
1 parent 9483e9b commit 72b7c8d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/librustdoc/html/static/main.js
Expand Up @@ -57,6 +57,12 @@
return this.indexOf(searchString, position) === position;
};
}
if (!String.prototype.endsWith) {
String.prototype.endsWith = function(suffix, length) {
var l = length || this.length;
return this.indexOf(suffix, l - suffix.length) !== -1;
};
}

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

function pathSplitter(path) {
return '<span>' + path.replace(/::/g, '::</span><span>');
var tmp = '<span>' + path.replace(/::/g, '::</span><span>');
if (tmp.endsWith("<span>")) {
return tmp.slice(0, tmp.length - 6);
}
return tmp;
}

function addTab(array, query, display) {
Expand Down

0 comments on commit 72b7c8d

Please sign in to comment.