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

Replace class=language-* w data-language=* to avoid potential Prism bug #1488

Closed
wants to merge 3 commits into from

Conversation

bvaughn
Copy link
Contributor

@bvaughn bvaughn commented Jul 12, 2017

Potential bug fix for issue #1486

Note that this would be a breaking change in terms of custom themes. If this approach seems reasonable going forward, I could hide it behind an option flag.

@KyleAMathews
Copy link
Contributor

KyleAMathews commented Jul 12, 2017

@bvaughn
Copy link
Contributor Author

bvaughn commented Jul 12, 2017

Hello fake @KyleAMathews bot 😁 It seems your deploy previews have been failing a lot lately, based on other recent PRs I see, so I'm going to ignore this message for now.

@gatsbybot
Copy link
Collaborator

gatsbybot commented Jul 12, 2017

Deploy preview ready!

Built with commit 05e361d

https://deploy-preview-1488--gatsbyjs.netlify.com

@gatsbybot
Copy link
Collaborator

gatsbybot commented Jul 12, 2017

Deploy preview ready!

Built with commit 05e361d

https://deploy-preview-1488--using-drupal.netlify.com

@gatsbybot
Copy link
Collaborator

gatsbybot commented Jul 12, 2017

Deploy preview ready!

Built with commit 05e361d

https://deploy-preview-1488--gatsbygram.netlify.com

@KyleAMathews
Copy link
Contributor

Bot Kyle has 1/100 my intelligence and all of my charm :-)

@KyleAMathews
Copy link
Contributor

So I like the solution but how about making this an option with the default false? With this change, prism themes would stop working unless you modify their selector which is doable but more work and confusing. I doubt most people will load prismjs into their page so won't run into the bug you're seeing.

@bvaughn
Copy link
Contributor Author

bvaughn commented Jul 13, 2017

Sounds great. That was what I had in mind when I mentioned the options flag. Just wanted to run the general approach by you first before spending too much time on it.

@KyleAMathews
Copy link
Contributor

👍

Default behavior remains as before, to use a class='language-*' prefix. New behavior allows for a data-language=* alternate.
Snapshot tests added.
@bvaughn
Copy link
Contributor Author

bvaughn commented Jul 13, 2017

What do you think of this approach?

@bvaughn bvaughn mentioned this pull request Jul 13, 2017
@bvaughn
Copy link
Contributor Author

bvaughn commented Jul 13, 2017

Or check out the alternate approach, #1491

@bvaughn
Copy link
Contributor Author

bvaughn commented Jul 13, 2017

Closing in favor of #1491

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

Successfully merging this pull request may close these issues.

3 participants