-
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
Issue#20000 markdown caption error for remarks image #22256
Issue#20000 markdown caption error for remarks image #22256
Conversation
Related to this PR: #16574 |
Hi! Any feedbacks from the owner? :) |
Hi @LekoArts , thank you for the reply! I checked the code in #21188, I've not tried or tested it but I guess it was a solution to solve the issue #20000 using I'll add tests to it once I have time! |
I've done more digging and I'm now convinced that the I've included my justification for this below. The functions in gatsby-transformer-remark/extend-node-type.js are written expecting markdownNode to look like this:
Normally, they seem to be invoked with objects created in the normal way. I think this problem started with My limited understanding here is:
And that passing the compiler option down is probably overcomplicating this feature. I think using the parsing libs directly makes more sense. |
@LekoArts There is already a full suite of tests for this feature. Previously, the tests were passing because the compiler option was mocked out incorrectly (the mock does exactly what this PR is doing and uses the parsing libs directly). The discrepancy between the mock and production code was a real issue. This PR now causes the tests to pass correctly. I think the only possible change to the tests might be to remove this line, since it's no longer used. I've tried this locally and the tests still pass. Perhaps we could get this PR merged so long, and open up a different discussion about the |
I guess the idea is that This fix will make it work with @mathieudutour What do you think on this? |
Yeah, the idea was that This fix is hardcoding
I think the proper fix is to make |
This PR will be subsumed by #21188 and is actively being worked on. Considering this issue has been open since December, I don't think an extra week delay for the fix is a big deal. As such I'm going to close this PR in favor and anticipation of merging #21188 @shan-hua Thank you for submitting the PR. Please don't feel discouraged for this closure! Your PR attempted to fix a bug in the codebase and we're grateful for it. If the issue is not fixed by the time #21188 lands, or if #21188 turns out to take much longer to land than "just a week", please reopen this and we'll try to get it merged as a workaround. |
Thank you very much! Sorry I've been completely out of Github community for workload reasons in the last two months. As I mentioned in the quick PR that there should be a better solution on the async issue which I could not be familiar with :) I already see there are updates regarding to #21188 and I'll have a look right away! Happy to continue working with Gatsby team |
About the issue: #20000
It is caused by using the async function in
compiler.generateHTML()
. Since the caption written in Markdown will not be converted into a node, I changed it into using unified parser directly. It works but maybe it affords a better solution..