Closed BluDood closed 1 year ago
I am also using NextJS if that helps. I'm rendering the HTML inside getServerSideProps, and passing it down to the component. That shouldn't matter much though, as the output itself never has the toolbar element.
I review the code of toolbar plugin,It seems to only work on the browser rather than server.
Is there a demo project that can be used for testing, maybe we need to implement this plug-in, like line-numbers
I have created a demo project here: BluDood/rehype-prism-test
typeof document === 'undefined'
is true on ssr. I have to rewrite this plugin....
In order to support server-side rendering, we need inline js scripts to implement the copy function
<a href="#" onClick="(function(){
// copy...
})();return false;">Copy</a>
install 2.2.2
Thank you!
Describe the bug I'm trying to add a toolbar with a Copy to Clipboard button to my parsed Markdown, but the toolbar and copy-to-clipboard plugins don't seem to do anything.
To Reproduce I use a parser function like this:
I have enabled the toolbar and copy-to-clipboard plugins, but they don't affect the output whatsoever.
Expected behavior The output should contain the toolbar section with the extra toolbar modules
Platform (please complete the following information):