Commit f6f14012 authored by Robert Griesemer's avatar Robert Griesemer

godoc: don't double HTML-escape search result snippets

Fixes #1412.

R=rsc, r
CC=golang-dev
https://golang.org/cl/3994041
parent cdb0bbf4
......@@ -93,7 +93,7 @@ func FormatSelections(w io.Writer, text []byte, lw LinkWriter, links Selection,
segment := func(end int) {
if lastOffs < end { // ignore empty segments
if last.end != lastOffs || last.bitset != bitset {
// the last segment is not adjacent or
// the last segment is not adjacent to or
// differs from the new one
flush()
// start a new segment
......
......@@ -26,7 +26,7 @@ type Snippet struct {
func newSnippet(fset *token.FileSet, decl ast.Decl, id *ast.Ident) *Snippet {
// TODO instead of pretty-printing the node, should use the original source instead
var buf bytes.Buffer
writeNode(&buf, fset, decl, true)
writeNode(&buf, fset, decl, false)
return &Snippet{fset.Position(id.Pos()).Line, FormatText(buf.Bytes(), -1, true, id.Name, nil)}
}
......
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