-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Styleguidist tries to render code blocks without language tag #641
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
Comments
This is expected behavior for backwards compatibility, use |
Allright. Could the documentation perhaps be updated to reflect this then? :) I can update the quoted line and add an entry to the cookbook if you'd like. |
We don’t recommend it but I agree it would be nice to mention that it still works ;-) I think this is the best place for it: https://github.com/styleguidist/react-styleguidist/blob/master/docs/Documenting.md (and it should be mentioned that this is backwards compatible mode, not recommended one). |
In issue #641 I was confused that code blocks without language tags were being rendered as a React component, and not a code documentation block. It turned out this was for backward compatibility reasons. This commit updates the documentation to hopefully avoid such confusion in the future. The docs now also suggest a workaround.
From the documentation it looks like only code blocks with the language tab
js
,jsx
, orjavascript
should render React components. However React Styleguidist even tries to render code blocks without a language tag.A workaround is to lie and mark the block as a valid but non-JavaScript/JSX language, for instance Java.
A repo which demonstrates the issue and workaround with a component called
Dots
: https://github.com/wkillerud/exampleI would expect code blocks with no language set to be rendered as a code block and not an interactive version.
The text was updated successfully, but these errors were encountered: