1
0
mirror of https://github.com/golang/go synced 2024-11-22 04:14:42 -07:00

doc/godoc.js: assign tmp. id to nodes without id in generateTOC()

R=adg
CC=golang-dev
https://golang.org/cl/6604062
This commit is contained in:
Shenghou Ma 2012-10-11 09:24:15 +11:00 committed by Andrew Gerrand
parent 7e196d0822
commit 6572c7ee93

View 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')) {