-
Notifications
You must be signed in to change notification settings - Fork 15
fix: respect the top-level copyButtons option
#990
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
Conversation
the RMDX compiler will now accept a `copyButtons` boolean within the options arg and properly pass it down to our custom `<Code>` component
pull over some polish work from #964 Co-authored-by: Trisha Le <trishaprilee@gmail.com>
I think the still valid options are: I don't think we're passing |
kellyjosephprice
left a comment
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.
LGTM.
Just now seeing that Settings is not considered extensible.
Another alternative would be to pass this down through a context. This is great though.
trishaprile
left a comment
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.
🙏
|
(gonna hold of on cutting a new release for this pending #992 so we can hopefully kill two birds w/one stone) |
## Version 7.6.7 ### ✨ New & Improved * **Image:** match new alignment selectors ([#992](#992)) ([73bca2b](73bca2b)) ### 🛠 Fixes & Updates * better tag handling ([#991](#991)) ([e6aa82d](e6aa82d)) * respect the top-level `copyButtons` option ([#990](#990)) ([1242413](1242413)), closes [#964](#964) [/github.com/readmeio/markdown/blob/96f9644f04e6d8e3ffff6f9c014432f901c0b804/lib/compile.ts#L28](https://github.com/readmeio//github.com/readmeio/markdown/blob/96f9644f04e6d8e3ffff6f9c014432f901c0b804/lib/compile.ts/issues/L28) [/github.com/readmeio/markdown/blob/96f9644f04e6d8e3ffff6f9c014432f901c0b804/lib/compile.ts#L28](https://github.com/readmeio//github.com/readmeio/markdown/blob/96f9644f04e6d8e3ffff6f9c014432f901c0b804/lib/compile.ts/issues/L28) [/github.com/readmeio/markdown/blob/b9502adb306f099cd91e005df17c0be252019814/options.js#L1-L22](https://github.com/readmeio//github.com/readmeio/markdown/blob/b9502adb306f099cd91e005df17c0be252019814/options.js/issues/L1-L22) ### 📘 Tests & Docs * readme updates ([#993](#993)) ([3a4e30d](3a4e30d)) <!--SKIP CI-->
This PR was released!🚀 Changes included in v7.6.7 |

🧰 Changes
The main
RMDX.compile()method should respect thecopyButtonsparam when rendering our code block components.Accept the
copyButtonsoption—we used to set this param directly on our custom Unifiedprocessor, but since Remark actually freeze's it's processor instance we can achieve a similar effect by passing it directly to theCodeTabsTransformerplugin as a configuration option:markdown/lib/compile.ts
Line 28 in 96f9644
Add a Copy Buttons toggle to the dev playground.1
Miscellaneous detailing and minor cleanup.
🧬 QA & Testing
Pull this PR down, run the
startscript, and navigate to the “Code Blocks” example. Try hovering over a code block to verify that the copy button is only shown if/when the Copy Buttons toggle is checked.Footnotes
@kellyjosephprice—do we even respect those other two global config options? I think
safeModeandlazyImagesboth have toggles in the playground, but there are a bunch of others which I'm not sure are still valid either? Anyways, just an aside, but it would be nice to clean this all up at some point! ↩