]> Cypherpunks repositories - gostls13.git/commitdiff
doc/godoc.js: assign tmp. id to nodes without id in generateTOC()
authorShenghou Ma <minux.ma@gmail.com>
Wed, 10 Oct 2012 22:24:15 +0000 (09:24 +1100)
committerAndrew Gerrand <adg@golang.org>
Wed, 10 Oct 2012 22:24:15 +0000 (09:24 +1100)
R=adg
CC=golang-dev
https://golang.org/cl/6604062

doc/godocs.js

index 8d4a8aab821bf7f880f42b9eaa3ff26cda780cd7..7449efc22868df7034856ea078ba52240317273f 100644 (file)
@@ -58,6 +58,8 @@ function generateTOC() {
   var toc_items = [];
   $(nav).nextAll('h2, h3').each(function() {
     var node = this;
+    if (node.id == '')
+      node.id = 'tmp_' + toc_items.length;
     var link = $('<a/>').attr('href', '#' + node.id).text($(node).text());
     var item;
     if ($(node).is('h2')) {