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): always include the root node of AST #12647

Merged
merged 1 commit into from
Mar 19, 2019

Conversation

chitoku-k
Copy link
Contributor

Description

Fixes a bug in cloneTreeUntil function in gatsby-transformer-remark, where it only returns the last child node. This function is expected to clone a root node, but the current implementation forgets to revert the variable back to the root node. Reassigning clonedRoot = newNode (originally this is the argument root) should fix this. By resolving this bug, it appears to correctly returns the entire root node of AST in excerptAst of the markdown node, instead of returning the partial result.

Related Issues

Related to #11237

@chitoku-k chitoku-k requested a review from DSchau March 18, 2019 17:33
@wardpeet
Copy link
Contributor

Seems legit 👍 thanks for creating this PR!

Copy link
Contributor

@DSchau DSchau left a comment

Choose a reason for hiding this comment

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

Thanks for this PR--we appreciate it!

Merging and will publish in a bit 💜

@DSchau DSchau merged commit f480a35 into gatsbyjs:master Mar 19, 2019
@DSchau
Copy link
Contributor

DSchau commented Mar 19, 2019

Successfully published:
 - gatsby-transformer-remark@2.3.7
@chitoku-k chitoku-k deleted the fix/transform-remark-node-root branch March 19, 2019 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants