You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I looked into it and I think the culprit is the copyCodeToClipboard function in clipboard.js. It is grabbing innerText which preserves the source code/DOM formatting. I think textContent is what you want instead based on some preliminary in-browser tweaking/testing and reading up on the different between those properties.
The text was updated successfully, but these errors were encountered:
@rothgar I tested this a little in the browser setting a breakpoint at the start of the copyCodeToClipboard function so the browser console had the same scope and then I ran the line with innerText manually replacing innerText with textContent and the line breaking looked more as expected so you might try that and see if that looks like the right thing to be copying.
Thanks for looking. I'm trying to figure out why we have a custom copy to clipboard function instead of using the one built in to docsy. I'm going to try removing it and see if I can figure out what (if anything) we lose.
@rothgar The custom implementation in this repository is from March 29, 2022 (6665e0f). The copy function in Docsy appears to have been added October 6, 2022 (google/docsy@de7048f). So I'd say it's a custom implementation since it just wasn't in Docsy at the time. If the Docsy version works acceptably, I certainly agree that's the way to go and drop the custom implementation.
Bug Report
As illustrated in Justin Garrison's live stream recently https://www.youtube.com/watch?v=xenP7jkecWA the copy functionality in the docs is picking up extra line breaks.
Description
I looked into it and I think the culprit is the copyCodeToClipboard function in clipboard.js. It is grabbing innerText which preserves the source code/DOM formatting. I think textContent is what you want instead based on some preliminary in-browser tweaking/testing and reading up on the different between those properties.
The text was updated successfully, but these errors were encountered: