docs: TOC shows text not anchor link am: 3b65aae27e

Original change: https://android-review.googlesource.com/c/platform/build/bazel_common_rules/+/1859996

Change-Id: Ib9bba1a33c7ed6f41d70d5540a9f8fbaa6ac4dd0
diff --git a/docs/index.html b/docs/index.html
index 9c5c171..66cd737 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -51,7 +51,7 @@
                 var clone = sampleTocItem.cloneNode(true)
                 var link = clone.getElementsByTagName("a")[0];
                 link.href = "#" + h2Elements[i].id
-                link.innerText = h2Elements[i].id
+                link.innerText = h2Elements[i].innerText
                 toc.appendChild(clone)
             }
             toc.appendChild(document.getElementById("div-sample-toc-break").cloneNode(true))