From f6f1401286adc6e67fc2a9f5b9651ef8ead309c9 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Thu, 13 Jan 2011 12:44:04 -0800 Subject: [PATCH] godoc: don't double HTML-escape search result snippets Fixes #1412. R=rsc, r CC=golang-dev https://golang.org/cl/3994041 --- src/cmd/godoc/format.go | 2 +- src/cmd/godoc/snippet.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmd/godoc/format.go b/src/cmd/godoc/format.go index 9a739d33be..c6fd90eeba 100644 --- a/src/cmd/godoc/format.go +++ b/src/cmd/godoc/format.go @@ -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 diff --git a/src/cmd/godoc/snippet.go b/src/cmd/godoc/snippet.go index 6a12febe14..c2838ed5a7 100755 --- a/src/cmd/godoc/snippet.go +++ b/src/cmd/godoc/snippet.go @@ -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)} } -- 2.50.0