1
0
mirror of https://github.com/golang/go synced 2024-10-03 06:31:22 -06:00

go/doc: add "hdr-" prefix to headers generated from package overviews.

R=golang-dev, bradfitz, gri
CC=golang-dev
https://golang.org/cl/6935071
This commit is contained in:
David Symonds 2012-12-18 12:19:04 +11:00
parent acbf011d96
commit 5b46fc417f

View File

@ -229,7 +229,8 @@ type block struct {
var nonAlphaNumRx = regexp.MustCompile(`[^a-zA-Z0-9]`)
func anchorID(line string) string {
return nonAlphaNumRx.ReplaceAllString(line, "_")
// Add a "hdr-" prefix to avoid conflicting with IDs used for package symbols.
return "hdr-" + nonAlphaNumRx.ReplaceAllString(line, "_")
}
// ToHTML converts comment text to formatted HTML.