my index-page displays blurbs with image and text.
But i cant get the text to be formated as HTML. Im using the markdown-widget with Netlify CMS and want linebreak to work when spacing content in the admin view.
ive tried use dangerouslySetInnerHTML={item.text}
aswell without any luck.
item is just a mapping of all blurbs.
<p> {item.text} </p>
graphql:
markdownRemark(frontmatter: { templateKey: { eq: "index-page" } }) {
frontmatter {
intro {
blurbs {
image {
childImageSharp {
fluid(maxWidth: 2048, quality: 100) {
...GatsbyImageSharpFluid
}
}
}
heading
text
}
heading
description
}
}
}
}
the label in config.yml:
- {label: "Intro", name: "intro", widget: "object", fields: [{label: "Heading", name: "heading", widget: "string"}, {label: "Description", name: "description", widget: text}, {label: Blurbs, name: blurbs, widget: "list", fields: [{label: "Image", name: "image", widget: "image"}, {label: "Rubrik", name: "heading", widget: "string"}, {label: "Text", name: "text", widget: "markdown"}]}]}
the Index.md i want to read from (i guess this works, due to the fact that i get the data to display, just not in html form)
blurbs:
- image: /img/img1.jpg
heading: heading one
text: >-
This is the content i want in HTML
- image: /img/img2.jpg
heading: heading two
text: >-
This is also the content i want in HTML
And this should give me a linebreak