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
bug
But instead nothing happens. There are no error messages in the browser. The code is within div.highlight pre selector, so the copy button should be present.
problem
Looking at the code, it seems that window.ClipboardJS is not initialized for some reason and that blocks adding copy buttons:
Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
@nijel out of curiosity (and thanks to 15 minutes free!) I made a build of Weblate's docs and, to my surprise, if you change the theme from furo to sphinx_rtd_theme, the copybuttons are shown. So in the end it might not be a bug in this extension, but some strange interaction with furo?
You're right, it works with some other theme. It also works with the Furo theme if I move the inclusion of the clipboard.min.js script somewhere in the middle of the document. I have no clue why it silently fails to initialize when it is at the bottom.
Instead of debugging obsolete code of clipboard.js, I decided to avoid it in #206
Describe the bug
context
When I go to https://docs.weblate.org/en/latest/api.html, the copy button is not present, while it works fine on other pages.
expectation
I expected copy button to occur.
bug
But instead nothing happens. There are no error messages in the browser. The code is within
div.highlight pre
selector, so the copy button should be present.problem
Looking at the code, it seems that
window.ClipboardJS
is not initialized for some reason and that blocks adding copy buttons:sphinx-copybutton/sphinx_copybutton/_static/copybutton.js_t
Line 129 in fae1f06
I have no clue why it fails to load, but maybe it's time to drop this code and use
navigator.clipboard.writeText
directly as described in #97?Reproduce the bug
I currently have no clue how to reproduce this outside our documentation. The source code is here: https://github.com/WeblateOrg/weblate/tree/main/docs
List your environment
The text was updated successfully, but these errors were encountered: