-
Notifications
You must be signed in to change notification settings - Fork 18k
x/website/internal/web: code examples render with double-escaped HTML #46839
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
Labels
Milestone
Comments
CarsonHoffman
added a commit
to CarsonHoffman/website
that referenced
this issue
Jul 5, 2021
4c9e549 introduced an issue causing non-playground code examples to be double-escaped, causing HTML escape sequences and elements to appear in the code, such as the examples in crypto/rsa, as reported in golang/go#46839. This change treats the code as `template.HTML` rather than `string` after running through (*Page).Node (which formats the code as HTML) and doing some basic transformations, preventing this double-escaping from occurring. Fixes golang/go#46839
CarsonHoffman
added a commit
to CarsonHoffman/website
that referenced
this issue
Jul 5, 2021
4c9e549 introduced an issue causing non-playground code examples to be double-escaped, causing HTML escape sequences and elements to appear in the code, such as the examples in crypto/rsa, as reported in golang/go#46839. This change treats the code as `template.HTML` rather than `string` after running through `(*Page).Node` (which formats the code as HTML) and doing some basic transformations, preventing this double-escaping from occurring. Fixes golang/go#46839
Change https://golang.org/cl/332889 mentions this issue: |
MK825
added a commit
to MK825/website
that referenced
this issue
Oct 18, 2022
CL 317655 introduced an issue causing non-playground code examples to be double-escaped, causing HTML escape sequences and elements to appear in the code, such as the examples in crypto/rsa, as reported in golang/go#46839. This change treats the code as template.HTML rather than string after running through (*Page).Node (which formats the code as HTML) and doing some basic transformations, preventing this double-escaping from occurring. Fixes golang/go#46839 Change-Id: Id226147eb51219bd5e2db61e959519258e39a298 GitHub-Last-Rev: 81f8dc5e878cd283f7d5865e73d214135838549b GitHub-Pull-Request: golang/website#73 Reviewed-on: https://go-review.googlesource.com/c/website/+/332889 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Trust: Cherry Mui <cherryyz@google.com>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
I'm running the latest Firefox & Chrome on Windows.
The HTML for examples are mangled on at least this page:
https://golang.org/pkg/crypto/rsa/#example_DecryptOAEP
For instance:
The text was updated successfully, but these errors were encountered: