-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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: avoid including line numbers when copying the code #18725
Conversation
☁️ Nx Cloud ReportCI is running/has finished running commands for commit f711a09. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch ✅ Successfully ran 1 targetSent with 💌 from NxCloud. |
Hey @donotlb thank you so much for your contribution! @ndelangen could you take a quick look at this? Thanks! |
I did more tests, and found that react-syntax-highlighter itself has a few problems, the copy-paste behavior is different in different browsers when showLineNumbers is turned on. We can visit here and test it with different browsers (remember to tick the “Show line numbers” checkbox) I found a simple workaround to make the copy-paste behavior more consistent across browsers: use a custom renderer to process How to test
|
# Conflicts: # code/lib/components/src/syntaxhighlighter/syntaxhighlighter.tsx
Hi @ndelangen, thanks for your review, are there plans to merge this PR ? |
When will this feature be included in the new release? It's really annoying to have line numbers copied. |
Issue: #18629
What I did
Removed the
onCopyCapture
event listener from the container element ofReactSyntaxHighlighter
.How to test
Start the html-kitchen-sink example, then open the Story addon panel of Button.Primary story, after that, select and copy (ctrl+c) the source code, and finally paste it somewhere.