-
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
Code parsed incorrectly in excerpts #10498
Comments
hmm after a little investigation, I think it might be unrelated to the |
Alright, just confirmed that my suspicion was correct. The issue appears when |
It turns out that when we were converted the HTML AST to an HTML string, we were not allowing for raw html input nodes. Basically, any raw HTML node was escaped. The attached PR changes this behavior. Note that this modified behavior aligns with how the resolver for the entire HTML document works |
#10499) fix issue #10498 The first commit was to fix some tests that were just totally not working. We weren't correctly passing around all of our pluginOptions. The second commit added a test that validated that `code` tags worked at all. Mostly a sanity check for me. Doesn't add a ton of value overall. The third commit the fix. One thing to note here is that I don't actually have a test for this issue. Off the top of my head, I'm not 100% sure how to test it. Maybe inserting raw HTML into the excerpt and expecting it to not get escaped would work? EDIT: Just added a test that makes sure we can render raw html in excerpts and replaced the less useful test from before.
gatsbyjs#10499) fix issue gatsbyjs#10498 The first commit was to fix some tests that were just totally not working. We weren't correctly passing around all of our pluginOptions. The second commit added a test that validated that `code` tags worked at all. Mostly a sanity check for me. Doesn't add a ton of value overall. The third commit the fix. One thing to note here is that I don't actually have a test for this issue. Off the top of my head, I'm not 100% sure how to test it. Maybe inserting raw HTML into the excerpt and expecting it to not get escaped would work? EDIT: Just added a test that makes sure we can render raw html in excerpts and replaced the less useful test from before.
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open! Thanks for being a part of the Gatsby community! 💪💜 |
Hey again! It’s been 30 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it. Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m Thanks again for being part of the Gatsby community! |
Description
When excerpts are queried from
gatsby-transformer-remark
using theformat: HTML
option, the resulting HTML is not parsed correctly.The system is returning something like this:
The problem is that the
code
tag is being processed as a text node rather than parsed as part of the HTML syntax tree. This is related to work I did adding theformat: HTML
option in the first place. I'll try to figure it out.Steps to reproduce
Make a GraphQL request like the following:
The text was updated successfully, but these errors were encountered: