-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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 copying in Firefox #2120
Conversation
Newlines in `<pre>` break lines, so the `display: block` on each `.line` would break the line again.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
Thanks @wongjn! I did notice that there's some sort of regressions with multi-line highlights now though (left is current site right is your change):

You can see that the width of the highlight no longer spans the whole code tag and that the lines no longer touch :/ I believe that was the issue we initially tried to fix with replaceAll("\n", "')
.
Ah that's a bummer. I'm afraid I don't have a Safari machine to debug either, sorry :( |
Seems to be related to the text not having newline characters. Testing with v3 docs with
<code>
elements:V3:
V4
This PR:
display: block
on the.line
elements since we can now rely on the newline characters within the<pre>
parent element'swhite-space: preserve
behavior.Tested in Firefox and Chrome on Windows for no visual regressions. Please test on Safari as I don't have access to that browser.
Fixes #1972.