My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

Can Markdown be used within Gatsby custom components?

Rhys's photo
Rhys
·May 28, 2019

Following the guide at https://using-remark.gatsbyjs.org/custom-components/ , I have been able to implement custom components I use throughout my Gatsby site.

Most components include injecting inner content within (eg. render() { return (<div>{this.props.children}</div>) }, but I notice that only HTML appears to be supported within, not Markdown.

For example, inner content must include full HTML tags like <h1>Title</h1> rather than Markdown's #Title.

Is it possible to support parsing the Markdown prior rendering the component? Or should I be using components and my templates differently?