Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/website/internal/talks: go.dev/talks that use .html command invocations fail to render #51989

Closed
dmitshur opened this issue Mar 28, 2022 · 1 comment
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@dmitshur
Copy link
Contributor

dmitshur commented Mar 28, 2022

For example, https://go.dev/talks/2014/go4gophers.slide uses .html (on slide 76) and currently fails to render with the error:

template execution: template: talks/slide.tmpl:60:27: executing "entirepage" at <fmt .>: error calling fmt: template: talks/slide.tmpl:1:0: executing "fmt" at <html>: error calling html: template: talks/slide.tmpl:188:19: executing "html" at <.HTML>: can't evaluate field HTML in type string

(Same problem also affects articles, e.g., https://go.dev/talks/2016/refactor.article.)

The problem involves the use of tmplfunc package, and I've reported more details about that upstream in rsc/tmplfunc#1.

I'll send a workaround CL with a test case for x/website for now.

@dmitshur dmitshur added the NeedsFix The path to resolution is known, but the work has not been done. label Mar 28, 2022
@dmitshur dmitshur added this to the Unreleased milestone Mar 28, 2022
@gopherbot
Copy link

Change https://go.dev/cl/396234 mentions this issue: cmd/golangorg, _content/talks: restore talks that use .html command

passionSeven added a commit to passionSeven/website that referenced this issue Oct 18, 2022
Invoke the template named "html" using the usual html/template way
instead of invoking it as a function (via the tmplfunc package) to
work around rsc/tmplfunc#1.

The package golang.org/x/tools/present imports "html/template" from
the standard library, so its HTML.HTML field of type template.HTML
isn't understood to be content from a trusted source by the internal
backported copy. Use type aliases for those special types to fix that.

Fixes golang/go#51989.
Updates rsc/tmplfunc#1.

Change-Id: Ib9609f41b17407e297ea3bb111f346188aa7a9b0
Reviewed-on: https://go-review.googlesource.com/c/website/+/396234
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Trust: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Jamal Carvalho <jamalcarvalho@google.com>
@golang golang locked and limited conversation to collaborators Mar 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

2 participants