]> git.lizzy.rs Git - rust.git/commitdiff
Remove extra span tags
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Sat, 5 May 2018 14:36:49 +0000 (16:36 +0200)
committerGuillaume Gomez <guillaume1.gomez@gmail.com>
Sat, 12 May 2018 17:16:37 +0000 (19:16 +0200)
src/librustdoc/html/static/main.js

index 8c4dac9238ce9e2d132aa546a4f2d56503fa85bc..b8d861d376f25f3db44a24baaf7c9042001a066e 100644 (file)
             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];
         }
 
         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) {