codeblock not showing copy button #9355
Replies: 2 comments 5 replies
-
|
Hello could you create a repro using playground I could not reproduce your error locally |
Beta Was this translation helpful? Give feedback.
-
|
I found this question searching for a similar issue that's just a bit different. I want to leave my solution here in case it is helpful to others. You can't use substitution with triple ticks: If you try to put this into CodeBlocks it will work, but the code will not be highlighted and you will not have a copy button. You must treat the code as a string for the formatting to work correctly. This will render as code, with the substitution in place: If have multiple lines of code you can use the single ticks to treat them as lazy strings. You can also have multiple lines wrapped in curly braces and just add I hope this helps... figure out why my code wasn't highlighting or having a copy button drove me a little batty 😃 |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
I have a codeblock in docs folder like this:



In the webpage the html is rendered with tag pre (no copy button):
The same code when pasted in a newly initialised docasaurus repo gives a html block like this(and also the codeblock contains a copy button):
Beta Was this translation helpful? Give feedback.
All reactions