From 6572c7ee93a3e070699806c5fc3b852aba58f529 Mon Sep 17 00:00:00 2001 From: Shenghou Ma Date: Thu, 11 Oct 2012 09:24:15 +1100 Subject: [PATCH] doc/godoc.js: assign tmp. id to nodes without id in generateTOC() R=adg CC=golang-dev https://golang.org/cl/6604062 --- doc/godocs.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/godocs.js b/doc/godocs.js index 8d4a8aab821..7449efc2286 100644 --- a/doc/godocs.js +++ b/doc/godocs.js @@ -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 = $('').attr('href', '#' + node.id).text($(node).text()); var item; if ($(node).is('h2')) {