Commit 5b46fc41 authored by David Symonds's avatar David Symonds

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

R=golang-dev, bradfitz, gri
CC=golang-dev
https://golang.org/cl/6935071
parent acbf011d
......@@ -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.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment