Markdownify renders plain text instead of table

Hi there,

I am new to hugo, and so far the journey has been excellent and a lot of fun, thanks a lot for that! There is only one thing that I can’t really solve or can’t find in the docs. I am trying to render a table via markdownify (comes from front matter). But somehow the tables gets rendered as plain text in a paragraph tag, whatever I try (surrounding it by breaks, spaces, headers etc.).

Some info:

  • hugo version: v0.69.2
  • Multi language, with default config and goldmark unsafe set to true
  • Setting content in front matter
  • rendering content in template with | markdownify

Content example:

content: >-
  ### Info


  ---

  * valid bullet
  * valid bullet


  | Option | Description |
  | ------ | ----------- |
  | data   | path to data files to supply the data that will be passed into templates. |
  | engine | engine to be used for processing templates. Handlebars is the default. |
  | ext    | extension to be used for dest files. |

Template render

{{ .content | markdownify  }}

result of table:

<p>| Option | Description | | —— | ———– | | data   | path to data files to supply the data that will be passed into templates. | | engine | engine to be used for processing templates. Handlebars is the default. | | ext    | extension to be used for dest files. |
      </p>

Problem:
Table renders as plain text in a paragraph tag, the rest of the markdown renders perfectly.

Maybe I missed configuration or anything else. Hopefully someone else had the same experience and fixed it somehow.

Cheers!
Paul

Use content: | or content: |-, instead of content: > or content: >-. See https://yaml-multiline.info. You are removing new lines that shouldn’t be removed.

Or just use the simple triple quote multiline that TOML allows.

Thanks a lot @jmooring! And thanks for pointing me to the right documentation.

Sorry by the way for the late response, we were busy launching the site, all went well without having tables :wink: So now its time for some finishing touches.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.