1
0
mirror of https://github.com/golang/go synced 2024-11-05 11:46:12 -07:00

go.tools/godoc: Fix jump-to-line in source view.

Remove the empty anchor element and add the line ID (Lnnn)
to the span element that contains the line number.
Fixes golang/go#5903.
Fixes golang/go#5977.

R=adg
CC=bradfitz, golang-dev
https://golang.org/cl/12189043
This commit is contained in:
Folke Behrens 2013-08-01 11:52:25 +10:00 committed by Andrew Gerrand
parent e7016436a6
commit 976d735966

View File

@ -359,7 +359,7 @@ func FormatText(w io.Writer, text []byte, line int, goSource bool, pattern strin
if line >= 0 {
lineTag = func(w io.Writer, _ int, start bool) {
if start {
fmt.Fprintf(w, "<a id=\"L%d\"></a><span class=\"ln\">%6d</span>\t", line, line)
fmt.Fprintf(w, "<span id=\"L%d\" class=\"ln\">%6d</span>\t", line, line)
line++
}
}