-
-
Notifications
You must be signed in to change notification settings - Fork 295
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
Code copy doesn't work when set highlight.noClasses = true
#154
Comments
I've been trying to replicate this issue without any success. I've tried both Safari and Firefox and the current selector seems to be working fine. Is this specific to a particular browser version or configuration? The problem with your change is that it will break the functionality of the code copy when the line numbers are enabled on the code block. If you remove |
I closed the PR but the problem still problem still exists, the exampleStie has same issue. I'm trying to figure out the root cause. |
Finally, I found this issue is caused by both |
Here are design options:
|
Well |
I've had a look into this and unfortunately Hugo doesn't allow themes to access the Markup config values and so I'm not able to add these warnings - see https://discourse.gohugo.io/t/how-do-i-get-the-noclasses-value/26395. I don't think there's much more I can add to this at this stage. |
highlight.noClasses = false
highlight.noClasses = false
highlight.noClasses = ture
highlight.noClasses = ture
highlight.noClasses = true
It looks the only thing we can do is to update configuration.md to highlight when |
I have made some changes to better explain these required params. Hopefully this makes it a bit clearer and will help others avoid this situation. |
What happened?
When I set
enableCodeCopy = true
, the copy button in the code blocks stuck and prompts the following in the browser console:Uncaught (in promise) TypeError: Cannot read properties of null (reading 'innerText')
at copyCodeToClipboard (main.bundle.min.998bd658c4cc3498df01180704ad0ea16bb3c0d6d118eb8ac6f557a59c86d1304d69e51ba7df5a9d203e2698d28571a422b4cf20f830810d571fee19fbcb55fc.js:11:695)
at HTMLButtonElement. (main.bundle.min.998bd658c4cc3498df01180704ad0ea16bb3c0d6d118eb8ac6f557a59c86d1304d69e51ba7df5a9d203e2698d28571a422b4cf20f830810d571fee19fbcb55fc.js:11:550)
Theme version
2.1.0
Hugo version
v0.94.2
What browsers are you seeing the problem on?
Chrome, Safari
Relevant Hugo log output
No response
The text was updated successfully, but these errors were encountered: