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

fix(gatsby-transformer-remark): Handle headings with nested text #11881

Merged
merged 4 commits into from
Feb 22, 2019
Merged

fix(gatsby-transformer-remark): Handle headings with nested text #11881

merged 4 commits into from
Feb 22, 2019

Conversation

diegohaz
Copy link
Contributor

@diegohaz diegohaz commented Feb 18, 2019

Description

Here's a fix. If there's a better way to write the solution, just let me know.

Related Issues

Fixes #11879

}`,
node => {
expect(node).toMatchSnapshot()
expect(node.headings).toEqual([
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice idea here with this failing test 👏

@stefanprobst
Copy link
Contributor

I'm sorry I missed this one before #11888
Anyway, we should make sure headings like the following are handled correctly:

# An **important** heading with `inline code` and text
@stefanprobst
Copy link
Contributor

@diegohaz I'll close #11888 in favor of this. We probably want to use mdast-util-to-string here, which handles formatted text as well as inlineCode.

@diegohaz
Copy link
Contributor Author

Thank you @stefanprobst. Added a test case with your example and fixed with mdast-util-to-string.

@diegohaz diegohaz changed the title fix(gatsby-transformer-remark): Return value from headings with backticks Feb 19, 2019
@sidharthachatterjee sidharthachatterjee self-assigned this Feb 20, 2019
Copy link
Contributor

@sidharthachatterjee sidharthachatterjee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @diegohaz 👍

@sidharthachatterjee sidharthachatterjee merged commit 4c0c5c0 into gatsbyjs:master Feb 22, 2019
@gatsbot
Copy link

gatsbot bot commented Feb 22, 2019

Holy buckets, @diegohaz — we just merged your PR to Gatsby! 💪💜

Gatsby is built by awesome people like you. Let us say “thanks” in two ways:

  1. We’d like to send you some Gatsby swag. As a token of our appreciation, you can go to the Gatsby Swag Store and log in with your GitHub account to get a coupon code good for one free piece of swag. (Currently we’ve got a couple t-shirts available, plus some socks that are really razzing our berries right now.)
  2. We just invited you to join the Gatsby organization on GitHub. This will add you to our team of maintainers. Accept the invite by visiting https://github.com/orgs/gatsbyjs/invitation. By joining the team, you’ll be able to label issues, review pull requests, and merge approved pull requests.

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!

@sidharthachatterjee
Copy link
Contributor

Published in gatsby-transformer-remark@2.2.6

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