react-code-blocks icon indicating copy to clipboard operation
react-code-blocks copied to clipboard

Error: Language cs not supported

Open cuongdo926 opened this issue 3 years ago • 6 comments

I used the below code. I tried both language csharp and cs. There is an error in the dev version but the style is still applied for the code block. In the build production version, the error is still there but there is no style for code. How can I fix this?

<CopyBlock
   language='csharp'
   text={codeString}
   wrapLines
   showLineNumbers
   theme={sunburst}
   codeBlock
 ></CopyBlock>

image

cuongdo926 avatar Oct 22 '21 04:10 cuongdo926

I'm having the same issue, and I believe it's a bug. From what I can see csharp is mapped to cs and passed to the PrismAsyncLight component from react-syntax-highlighter which expects csharp as the language.

laurawarr avatar Dec 14 '21 21:12 laurawarr

@rajinwonderland can you confirm? I'd be happy to submit a PR

laurawarr avatar Dec 14 '21 21:12 laurawarr

I have the same issue, cs and csharp don't work

anonomity avatar Dec 16 '21 09:12 anonomity

Hi. I am using v0.0.9-0 of react-code-blocks with react v16.14.0 and I am still getting this error? Do you have any updates on this? Thanks!

DCosti avatar Feb 24 '22 09:02 DCosti

Hello! Same here, any news on this? Thanks 🙏

mdubus avatar Mar 24 '22 11:03 mdubus

I ended up just switching to use react-syntax-highlighter instead

laurawarr avatar Mar 26 '22 04:03 laurawarr