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

Syntax highlighting: highlight.js doesn't work well with JSX #388

Closed
brentvatne opened this issue Jan 10, 2018 · 2 comments
Closed

Syntax highlighting: highlight.js doesn't work well with JSX #388

brentvatne opened this issue Jan 10, 2018 · 2 comments

Comments

@brentvatne
Copy link

brentvatne commented Jan 10, 2018

Is this a bug report?

Kind of -- lots of people using Docusaurus will probably use it for React related projects (I'm using it for React Navigation).

Have you read the Contributing Guidelines?

Yes!

Environment

Not relevant

Steps to Reproduce

Add this code block:

class DetailsScreen extends React.Component {
  render() {
    return (
      <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
        <Text>Details Screen</Text>
        <Button
          title="Go to Details... again"
          onPress={() => this.props.navigation.navigate('Details')}
        />
        <Button
          title="Go back"
          onPress={() => this.props.navigation.goBack()}
        />
      </View>
    );
  }
}

Expected Behavior

I expected it to look more like how it does above ^

Actual Behavior

screen shot 2018-01-10 at 2 55 26 pm

Reproducible Demo

Ideas

It looks like we used to use Prism.js, perhaps it'd be best to switch back to using it. There's a longstanding issue on the highlight.js repo about JSX support and no signs of progress.

@JoelMarcey
Copy link
Contributor

Sigh - sorry for not getting to this issue sooner. :(

Although, I guess I the result would have been the same unless we supported prismjs again. Which may not be hard to add back since we did it before :)

I think it is time for a non-feature-enhancement issue triage :)

@brentvatne
Copy link
Author

haha, no problem @JoelMarcey, my fork has worked fine for me so far!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants