Markdown editor does not insert paragraphs

Hi all,
For a custom input I want to use the markdown editor. It saves the content, but it does not recognize paragraphs in the text and just puts it all after each other as if it’s one big string. The default ‘content’ input does recognize the paragraphs in the text and outputs it in <p></p>. This is the yaml I use in my blueprint:

header.company_description:
  # type: editor
  type: markdown
  label: Description
  validate:
    type: textarea

I tried both type: editor - as I read in the documentation - and type: markdown - as it is configured in the system’s default blueprint (line 30). Is there something I can do to fix this issue?

Might want to create an issue on the Admin plugin, so we can investigate this issue: https://github.com/getgrav/grav-plugin-admin/issues

What works for me in this case is to use the markdown filter in the twig template:

{{ header.company_description|markdown }}

Maybe this solves your problem?

1 Like

Thanks for your reply! I will add an issue to github. @benigartenmann it’s for an input in the admin, so I need to trigger the markdown editor from the blueprint. Thanks for your advice anyway!

Ah yes. You will need to use the markdown filter as the data is stored in markdown and not in HTML.

The editor field simply provides the code editor. It doesn’t actually perform any markdown to HTML processing.

Aha, now I get it! Thanks!

Yep, totally worked :slight_smile: thanks!