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/pkgsite: example code doesn't display without JavaScript #46302

Closed
arp242 opened this issue May 21, 2021 · 1 comment
Closed

x/pkgsite: example code doesn't display without JavaScript #46302

arp242 opened this issue May 21, 2021 · 1 comment
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. pkgsite

Comments

@arp242
Copy link

arp242 commented May 21, 2021

When JavaScript is disabled the examples aren't loaded properly, although the example output does show. For example at https://pkg.go.dev/golang.org/x/text@v0.3.6/message#example-Printer-MVerb :

screenshot_2021-05-21-19-21-35_border

Because it has overflow: hidden and resize: none there's no way to scroll or do anything with that.

From what I can find in a quick search, automatically sizing a textarea height to fit the content isn't really possible without JavaScript; but at least removing those two attributes makes it usable, albeit awkward, instead of completely unusable as it is now.

The Best Way™ would of course be to just output a <pre> tag and then overwrite that with a fancy textarea in JavaScript.

This is in Firefox on Linux, but it should display the same problem in any browser AFAIK.

@gopherbot gopherbot added this to the Unreleased milestone May 21, 2021
@jba jba added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label May 21, 2021
@jba jba modified the milestones: Unreleased, pkgsite/unplanned May 21, 2021
@gopherbot
Copy link

Change https://golang.org/cl/321833 mentions this issue: content,internal: fix example code rendering with JS disabled

@golang golang locked and limited conversation to collaborators May 24, 2022
@rsc rsc unassigned jamalc Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. pkgsite
Projects
None yet
Development

No branches or pull requests

4 participants