-
Notifications
You must be signed in to change notification settings - Fork 239
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
gatsby-remark-prismjs line highlight breaks when react-live is included #22
Comments
Poking this apart further, it looks like |
Hm, so it seems that the gatsby-remark plugin is importing the entire prismjs lib, and then dynamically importing languages. I'm not sure what the issue is, but importing It's quite possible that this causes issues due to multiple Edit:
Prism doesn't take control over an element but instead just takes a string of code and returns html code as a string. So it's an import issue. Edit 2: It might be resolved by replacing the |
Yeah, it looks like the copy of |
Scratch that. Prism's line highlighting seems pretty fragile/busted and this looks like a dead-end based on my initial testing. |
Looks like maybe this can be avoided by removing the At this point, this is clearly not an issue with |
@bvaughn cool 😄 just ping me here if you think that we need to change something in react-live to avoid more of these kinds of issues. btw glad to see that you're looking into react-live for the React docs 😉 You were working on that with @joecritch, right? 😄 |
Thank you! Yes, it's an ongoing effort. 😄 |
I recently noticed a bug with the
gatsby-remark-prismjs
plugin on a site I'm working on: code line-highlights show up when I navigate to a page initially, but if I reload the page in place they're missing. (There's no wrapper<span class="gatsby-highlight-code-line">...</span>
after a page reload).After a lot of trimming down, I've been able to demonstrate this bug in a small repro (at bvaughn/gatsby-remark-prismjs-react-live-bug). The tl;dr is that including any
react-live
component (even if it's not used) will break thegatsby-remark-prismjs
plugin line highlight.I will attempt to further track this issue down. I'm also unclear about whether I should file this as an issue for Gatsby or React Live, but I suspect it's most likely something that should be fixed in React Live.
Relates to gatsbyjs/gatsby/issues/1486
The text was updated successfully, but these errors were encountered: