I am using Gatsby.js & using GraphQL to retrieve data from the markdown file. The markdown file has the content structure as:
---
title: abc
---
- heading A
- sub-heading A
- sub-heading B
- heading B
- sub-heading A
- sub-heading B
- sub-heading C
...
Using the plugin gatsby-transformer-remark
, the graphql output I get is something like this:
{
"data": {
"allMarkdownRemark": {
"edges": [
{
"node": {
"internal": {
"content": "\n- heading A\n - sub-heading An - sub-heading B\n- heading B ....
Is it possible to get an array or even an object of the markdown list so I can map (loop) over the values in my javascript code?
Thanks