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

Bug: Code block Copy Button is showing on non-Bash codeblocks #4943

Open
3 tasks done
Asartea opened this issue Feb 23, 2025 · 0 comments
Open
3 tasks done

Bug: Code block Copy Button is showing on non-Bash codeblocks #4943

Asartea opened this issue Feb 23, 2025 · 0 comments
Labels
Status: Needs Review This issue/PR needs an initial or additional review Type: Bug Involves something that isn't working as intended

Comments

@Asartea
Copy link
Contributor

Asartea commented Feb 23, 2025

Checks

  • I have thoroughly read and understand The Odin Project Contributing Guide
  • The title of this issue follows the Bug: brief description of bug format, e.g. Bug: Lesson complete button does not update on click
  • Would you like to work on this issue?

Bug description

When the copy button was originally introduced, it was restricted to only Bash, to preserve the effect of actually typing out the code for other languages. This is enforced on a technical level by this block of code in prism-theme.css:

pre.highlight:not(.language-bash) + .toolbar {
display: none;
}

On the production site, however, this appears to have failed however, as I see it in other languages as well. Even more bizarrely, when I load up an up to date copy of the site locally, it does work

How to reproduce

  1. Go to https://www.theodinproject.com/lessons/node-path-react-new-introduction-to-state#the-usestate-hook
  2. Hover over the JS codeblock
  3. Observe the copy button

Expected behavior

The copy button does not appear

What browsers are you seeing the problem on?

Firefox, Chrome

What OS are you using?

Windows

Discord Name

asarta

Additional Comments

Point of consideration: given this has been broken for who knows how long, and nobody has complained, is it even worth preserving this restriction?

@Asartea Asartea added Status: Needs Review This issue/PR needs an initial or additional review Type: Bug Involves something that isn't working as intended labels Feb 23, 2025
@github-project-automation github-project-automation bot moved this to 📋 Backlog / Ideas in Main Site Feb 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Review This issue/PR needs an initial or additional review Type: Bug Involves something that isn't working as intended
Projects
Status: 📋 Backlog / Ideas
Development

No branches or pull requests

1 participant