Skip to content

Commit f520785

Browse files
committed
internal/web: fix syntax rules hyperlinks
The filepath for the spec document changed and broke the linkify step. Fixes golang/go#50915 Change-Id: Ieafe9c665f4063fb9f9ddf74610925f123e2c249 Reviewed-on: https://go-review.googlesource.com/c/website/+/388859 Run-TryBot: Jamal Carvalho <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Robert Griesemer <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Trust: Jamal Carvalho <[email protected]>
1 parent 02f43ed commit f520785

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

cmd/golangorg/testdata/web.txt

+3
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,9 @@ redirect == https://go.dev/ref/spec
339339
GET https://go.dev/ref/spec
340340
body contains Go Programming Language Specification
341341

342+
GET https://go.dev/ref/spec
343+
body contains <a id="assign_op">assign_op</a>
344+
342345
GET https://golang.org/robots.txt
343346
redirect == https://go.dev/robots.txt
344347

internal/web/site.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ func (s *Site) serveHTML(w http.ResponseWriter, r *http.Request, p *pageFile) {
525525
}
526526

527527
// if it's the language spec, add tags to EBNF productions
528-
if strings.HasSuffix(filePath, "go_spec.html") {
528+
if strings.HasSuffix(filePath, "ref/spec.html") {
529529
var buf bytes.Buffer
530530
spec.Linkify(&buf, []byte(src))
531531
src = buf.String()

0 commit comments

Comments
 (0)