-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
feat(gatsby-remark-embed-snippet): apply gatsby-remark-prismjs configuration to embedded snippets #13973
feat(gatsby-remark-embed-snippet): apply gatsby-remark-prismjs configuration to embedded snippets #13973
Conversation
It looks good 👍 I think this change warrant doing major version bump for |
Hi @pieh, thanks for the thumbs up : )! Though as I already tested it in |
What I meant by changed behaviour, is that if you specify line numbering option (right now), it won't be used for embedded snippets. If I understand changes here correctly - this will fix it, so fixing this, also changes behaviour (different output for same plugin options) ;) |
*hmmz* But it fixes behavior in a backwards compatible manner, or doesn't it? Just thinking according to SemVer that'd be a minor version update. But what's semver more than "semantics" - so let's not dive into them ; ). In the end it's up to you and the other maintainers anyway ^^. |
Anyone willing to give this a review, please : )? |
@marcysutton @KyleAMathews @DSchau |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems pretty reasonable to me.
I think @pieh's reservation about a major bump (which is reasonable) is more that we can't guarantee this doesn't break something. While testing with reactjs.org is great (and thank you for doing it!), it doesn't guarantee nothing is broken. Since this is a possibly breaking change, I'd be fine releasing this as a major bump to just be on the safe side.
Co-Authored-By: Dustin Schau <DSchau@users.noreply.github.com>
Thanks for reviewing it, @DSchau! |
We do squash commits from PR, so merging I will do major version bump - this was never a blocker, just a note. We can bump plugins major versions when needed and this is not tied to Gatsby core package major versions bump which are far less frequent. |
…y-remark-prismjs-do-the-heavy-lifting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for patience on this. Changes looks good!
Holy buckets, @timhagn — we just merged your PR to Gatsby! 💪💜 Gatsby is built by awesome people like you. Let us say “thanks” in two ways:
If there’s anything we can do to help, please don’t hesitate to reach out to us: tweet at @gatsbyjs and we’ll come a-runnin’. Thanks again! |
Published Also added some BREAKING CHANGES note in changelog - https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-remark-embed-snippet/CHANGELOG.md#400-2019-06-14 |
…uration to embedded snippets (gatsbyjs#13973) BREAKING CHANGE: Configuration of `gatsby-remark-prismjs` is used to generate markup for code snippets. `classPrefix` option has been removed from `gatsby-remark-embed-snippet` (same option in `gatsby-remark-prismjs` will be used instead).
…uration to embedded snippets (gatsbyjs#13973) BREAKING CHANGE: Configuration of `gatsby-remark-prismjs` is used to generate markup for code snippets. `classPrefix` option has been removed from `gatsby-remark-embed-snippet` (same option in `gatsby-remark-prismjs` will be used instead).
Description
This is the continuation of PR #13841, which I sadly botched % ).
Added my changes here again on a clean fork.
While writing a documentation page for
gbi
, I noticed that line numbering and some other options ofgatsby-remark-prismjs
weren't working here. Stepping through it with Intellij Idea's Debugger confirmed that thevisit(markdownAST,
code, node => {...}
branch of it was of course never reached, as this plugin already had processed it to HTML.So I changed the constructed
node.type
tocode
, just gave the read in file asnode.value
and addednode.lang
to the returned node, which are needed for further processing down the line.It just seemed unnecessary to duplicate
gatsby-remark-prismjs
's code-highlighting functionality by creating nearly the same output (and it should prevent any future deviations).Related Issues
Fixes the issue I would have opened otherwise ; ).