Skip to content
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

"shell" is not supported #19

Closed
lawrenceching opened this issue Oct 17, 2020 · 8 comments
Closed

"shell" is not supported #19

lawrenceching opened this issue Oct 17, 2020 · 8 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@lawrenceching
Copy link

Hi
I saw the shell is supported in this page:
https://github.com/rajinwonderland/react-code-blocks/blob/master/LANGUAGES.md

But it gave me this error

Unhandled Rejection (Error): Language shell not supported

image

"bash" is working ok.
Would it be a typo in the document?
Where is the gold source of all supported language list?

Thanks in advanced

@lawrenceching
Copy link
Author

Reading your code, I saw you're using Prism highlighter by default

// https://github.com/rajinwonderland/react-code-blocks/blob/master/packages/react-code-blocks/src/components/Code.tsx#L2

import React, { PureComponent } from 'react';
import { PrismAsyncLight as SyntaxHighlighter } from 'react-syntax-highlighter';
import { applyTheme } from '../utils/themeBuilder';

And you normalized the bash to shell

// https://github.com/rajinwonderland/react-code-blocks/blob/master/packages/react-code-blocks/src/utils/normalizeLanguage.ts#L67-L70

{
    name: 'Shell',
    alias: ['shell', 'bash', 'sh', 'ksh', 'zsh'],
    value: 'shell',
  },

And then I checkout the react-syntax-highlighter
https://github.com/react-syntax-highlighter/react-syntax-highlighter/tree/master/src/languages/prism

It looks like Prism support bash instead of shell.
However, hljs supports both bash and shell.

@rajinwonderland
Copy link
Owner

Great catch @lawrenceching I'll go ahead and fix this!

@thesobercoder
Copy link

Is this fixed? I'm still getting the error.

@SebasG22
Copy link

I'm getting the same error but with html.
Language html not supported
Hopefully, a fix should be on the way.

@rajinwonderland
Copy link
Owner

@SebasG22 try using markup instead of html! Here's a previous issue for further clarification

@thesobercoder @lawrenceching I'll be hopefully free this weekend to push a new release! 🤞

Always accepting PRs too!

@rajinwonderland rajinwonderland self-assigned this Feb 18, 2021
@rajinwonderland rajinwonderland added bug Something isn't working help wanted Extra attention is needed labels Feb 18, 2021
@mat250
Copy link

mat250 commented Mar 3, 2021

Hi @rajinwonderland, I tried this weekend to push a PR to you to fix it, but I was unable to fork the repo and make it worked on my laptop.
Are there any requirements or pre-build operations to do to make this project work locally ?

For example, I had some trouble with the command yarn workspace command.

@rajinwonderland
Copy link
Owner

Hey @mat250 sorry for answering so late!

You want to:

Install Dependencies

yarn

Start Storybook

yarn pkg storybook 

Build the Package

yarn pkg build

Watch the package

yarn pkg start

Preview on Demo

yarn start:demo

or

yarn demo start

Submit PR

🎉🎉🎉🎉

Let me know if this helps!

@bofeiw
Copy link
Contributor

bofeiw commented Apr 9, 2021

This issue still occurs in version 0.0.8 published in npm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

6 participants