diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2018-05-05 16:36:49 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2018-05-12 19:16:37 +0200 |
| commit | 72b7c8d2912b062e421bf17a584835e2ac66c124 (patch) | |
| tree | 678da52936af3640dcff91e407f9be196aeed9dd | |
| parent | 9483e9b56474788e6549a1922e57f4a65c1c0bb0 (diff) | |
| download | rust-72b7c8d2912b062e421bf17a584835e2ac66c124.tar.gz rust-72b7c8d2912b062e421bf17a584835e2ac66c124.zip | |
Remove extra span tags
| -rw-r--r-- | src/librustdoc/html/static/main.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js index 8c4dac9238c..b8d861d376f 100644 --- a/src/librustdoc/html/static/main.js +++ b/src/librustdoc/html/static/main.js @@ -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]; @@ -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) { |
