Markdownify not rendering table

I’m trying to render a html table using the markdownify function, but for some reason it’s coming out as just a <p> with all of the “table content” in it.

My markdown is defined as:

    content: >
      # What's my Skill Set?

      I have extensive experience in Docker, K8s, Jenkins, Ansible, Terraform and more.  I has worked in a wide breadth of companies across a variety of industries ranging from small gaming companies to large financial institutions, and have experience at every level of the software development lifecycle.  I can help empower your team to succeed.
      
      ## test

      | Syntax | Description |
      | --- | ----------- |
      | Header | Title |
      | Paragraph | Text |

And it’s being rendered using markdownify here as:

    <div class="skill__progress_heading mb-5">
        <span class="top-title pre-line">{{ .topTitle }}</span>
        {{ .content | markdownify }}
    </div>

However, if you look at the deployed site: https://deploy-preview-1--aaronnbrock.netlify.app/#skill

You’ll notice all the other markdown is rendered correctly, but the table just doesn’t seem to work.

Links to actual code (in a code block, since I’m a new user):

Link where markdown if defined: 
https://github.com/AaronNBrock/AaronNBrock.com/blob/f3b55ab41b5c17adc2ba397f321c314421b34289/data/skillSection.yml#L4-L14

Link to where the markdown is rendered
https://github.com/AaronNBrock/portio-hugo/blob/a6f63a36db97c6ba230007cc04d626b3b9a3c7c1/layouts/partials/skillSection.html#L42

Lastly, if it’s helpful you can see my config.toml here.

Try putting the following into your config.toml:

[ markup.goldmark ]
[ markup.goldmark.extensions]
    table = true

Tables are actually not part of Markdown itself, but they can be enabled by this parameter. I am not sure if that is the default setting, I thought it’s always enabled.

Maybe it’s an issue with the space in front of the | linestart.

1 Like

You are removing new lines that should not be removed. Use | instead of >.

See https://yaml-multiline.info.

1 Like

You both hit on the issue! Using | instead of > solved the problem!

Now to refactor my entire theme, since I used > everywhere.

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