]> Cypherpunks repositories - gostls13.git/commitdiff
godoc: don't double HTML-escape search result snippets
authorRobert Griesemer <gri@golang.org>
Thu, 13 Jan 2011 20:44:04 +0000 (12:44 -0800)
committerRobert Griesemer <gri@golang.org>
Thu, 13 Jan 2011 20:44:04 +0000 (12:44 -0800)
Fixes #1412.

R=rsc, r
CC=golang-dev
https://golang.org/cl/3994041

src/cmd/godoc/format.go
src/cmd/godoc/snippet.go

index 9a739d33bef295f07d03fd336a37b52ce0aa593a..c6fd90eeba318700530fd033b6f471d467f84b69 100644 (file)
@@ -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
index 6a12febe14bdf29f812e900634feb55a83a61339..c2838ed5a77d24d7eca1592c56265ef6f0eccb3d 100755 (executable)
@@ -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)}
 }