-
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
fix(gatsby-transformer-remark): fix excerpt generation - strip excessive white spaces, extract alt from images #12878
Conversation
@macklinu mind fixing this as well? Thanks for creating the test, if you don't really know how we can take over from here. |
@wardpeet I'll take a look at patching this and ping you if I come up with a solution or need to ask for another contributor's help. Thank you! |
Would it make sense to use gatsby/packages/gatsby-transformer-remark/src/extend-node-type.js Lines 412 to 449 in 15ef178
|
strip-markdown strips markdown away, we still want to show the link or bold text right? That plugin just makes the text unstyled. So if not mistaken it's not really what we're after |
Ah, I see. I think my failing test assertion is incorrect then. We don't want to necessarily strip markdown, but we just want to preserve markdown as is and not remove any content? |
yes, the issue is that an extra space is added between the link & the ! symbol. It might be something that we have to fix upstream. |
Hi @macklinu 👋, First thanks for your failing test it really helped me diving in this bug 👏 I'm not sure to understood all you said with @wardpeet. I found out that the function Was that the right thing to do ? Sorry to not asking before pushing on your branch 😊 |
5fbeb59
to
8859d42
Compare
8859d42
to
f03bb80
Compare
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.
Nice! Just one nitpicky comment/question about value of snapshot in the test (as most value comes from node.excerpt
assertion)
packages/gatsby-transformer-remark/src/__tests__/extend-node.js
Outdated
Show resolved
Hide resolved
packages/gatsby-transformer-remark/src/__tests__/extend-node.js
Outdated
Show resolved
Hide resolved
Thanks for your review @pieh 👍 |
Sweet! thanks for getting this PR through the door @frinyvonnick! I'll fix the unit test. |
Thanks @wardpeet 🙏 ! |
pretty sure we can ignore danger here. |
Published in |
Description
This is a failing test case to reproduce the issue stated in #12398. Here is a screenshot of test failure output:
Related Issues
Relates to #12398