Open o-az opened 3 months ago
@o-az I noticed that the "copy" button shows fine in my local deployment but it doesn't show in my live deployment although the copy button fragment is present (tested with document.querySelector('.rehype-pretty-copy');
). Do you know what could be the reason of it?
Here is my live deployment which should show the button: https://typescript.tv/hands-on/all-you-need-to-know-about-iterators-and-generators/
UPDATE: The problem was related to @playform/compress
. It compresses HTML, SVG, etc. - I removed the plugin from my Astro config and now the copy to clipboard button can be viewed just fine. 😊
Btw, the copy plugin seems to be broken for me.
Btw, the copy plugin seems to be broken for me.
got a reporo?
@bennycode glad you were able to set it up! Updated docs should be out very soon :)
new docs are finally in a decent-enough place. Publishing soon
The copy button for Next.js fails with the typical text doesn't match server rendered.
I get a error for Next.js
Error: Expected `onClick` listener to be a function, instead got a value of `string` type.
Hello, I was searching on how to add a copy-to-clipboard button using rehype-pretty-code in my Astro blog. Fortunately, I stumbled upon some clues in your code:
To make it work, I've included
@rehype-pretty/transformers
in my project:Afterward, I updated the options in my
astro.config.ts
file:The results look amazing!
Thank you very much, Benny