-
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-source-contentful): LongText fields require markdown transformer #20398
Conversation
…by-transformer-remark As shown here: #3205 (comment) you cannot simply do ```{ body{ body} } since the body will be raw markdown, which is not html
Co-Authored-By: Vladimir Razuvaev <vladimir.razuvaev@gmail.com>
The text might not be perfect but it clearly explains what happens. Feel free to reuse it or change it.
pinging @jserrao as he authored this part I'm trying to clarify. |
@slk333 - I remember when I wrote this, you had to include |
at the moment, here's what you get when you query the child node: As for React Markdown:The advantage of a React Markdown component was that you don't have to do the inline html insert, which looks bad. You could simply take the markdown node and do:
credit @bowenac |
Weird, that night have changed. I don't think it was always encoded like
that.
…On Thu, Jan 9, 2020, 16:42 slk333 ***@***.***> wrote:
at the moment, here's what you get when you query the child node
[image: Screenshot 2020-01-09 at 22 40 54]
<https://user-images.githubusercontent.com/23578949/72107217-31caa680-3331-11ea-8ee2-53474944176f.png>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#20398?email_source=notifications&email_token=AAHHKVX37ENTF2WYPJWFUVTQ46K2PA5CNFSM4KCOEBKKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIR4JTI#issuecomment-572769485>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHHKVVPHCIAFZ23GZHLDV3Q46K2PANCNFSM4KCOEBKA>
.
|
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.
Content looks accurate to me (tried with contentful) but I think we need another pair of eyes from @gatsbyjs/learning to approve the text
sorry I didn't intend to delay the review, didn't see you asked for a review. Thanks @vladar |
Looks like P.S. Thanks for this fix by the way! |
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.
Looks good to me! Thanks for the clear explanation.
Hi @vladar , thanks for your help! I'm still a bit confused on how to fix the lint check failure. Do I have to download the whole gatsby repo and run |
Was able to run it for you :) Thanks so much for the PR! |
TLDR: The main problem is that if you follow the current documentation, you end up with raw markdown in your pages instead of the expected formatted content
As shown here: #3205 (comment)
this means doing the following will return raw markdown instead of html.
You have to use a transformer plugin to transform the markdown into html.
The doc was misleading since it suggested that using LongText can be used without a transformer, and said that the markdown was transformed by Gatsby (incorrect). As a result, if someone were to follow the example, he would get raw markdown displaying in the webpage, as opposed to the expected result.
Description
Documentation
Related Issues