-
Notifications
You must be signed in to change notification settings - Fork 15
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
fix(code-block): fix language-undefined in MDX CodeTabs #768
Conversation
π¦ Changeset detectedLatest commit: f15c0a3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git βοΈ
|
π¦ Canary Packages PublishedLatest commit: f15c0a3 Published 1 packages@hashicorp/react-code-block@6.2.1-canary-20221019235743
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! Do you think there's any reason why we would want to retain the ignoring of other passed className
values?
@brkalow I think my previous reasoning was to try to preemptively prevent any custom styling in MDX contexts. But in retrospect I don't think that made all that much sense, custom styling would probably happen through the |
Makes sense, thanks for the insight! |
* fix: fix language-undefined in MDX CodeTabs * chore(code-block): add changeset
ποΈ Asana Task
π Preview Link
Fixes a bug where
shell-session
snippets withinCodeTabs
would copy correctly via theCopy
button, but would still include the$
character when selected and copied by clicking and dragging.Details
Removes a
className
attribute that passed a non-existent className, which also dropped any incoming classNames. This was originally intended to prevent the possibility of custom styling via MDX, but has the side-effect of dropping thelanguage-<language>
class. That language class was unused for the most part (highlighting happens on the server!), but has become important for full functionality since #736 shipped.This approach has been proven out in hashicorp/dev-portal#1268. Screenshots below are from that PR, demonstrating that with this fix, we go from the issue-causing
language-undefined
tolanguage-shell-session
.Before
After
PR Checklist π
Items in this checklist may not may not apply to your PR, but please consider each item carefully.