Git Product home page Git Product logo

Comments (8)

bofeiw avatar bofeiw commented on June 19, 2024 4

This issue still occurs in version 0.0.8 published in npm.

from react-code-blocks.

lawrenceching avatar lawrenceching commented on June 19, 2024 2

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.

from react-code-blocks.

rajinwonderland avatar rajinwonderland commented on June 19, 2024 1

@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!

from react-code-blocks.

rajinwonderland avatar rajinwonderland commented on June 19, 2024

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

from react-code-blocks.

thesobercoder avatar thesobercoder commented on June 19, 2024

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

from react-code-blocks.

SebasG22 avatar SebasG22 commented on June 19, 2024

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

from react-code-blocks.

mat250 avatar mat250 commented on June 19, 2024

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.

from react-code-blocks.

rajinwonderland avatar rajinwonderland commented on June 19, 2024

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!

from react-code-blocks.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.