0
votes

In jekyll there's a markdownify liquid filter which will parse the text to html according to standard markdown specifications. However I want to filter the text to the kramdown specifications so I can use kramdown features (such as classname, inline style etc..).

The default markdownify filter doesn't parse kramdown, I have tried using kramdownify, and I have already set the default markdown parser to kramdown in _config.yml. Both to no avail.

Here's an example I want to achieve:

some-blog.md

---
layout: default
page_description: >
   **kramdown formated text**
   {: style="color: red"} // kramdown specification for inline style

---

default.html

{{ page.page_description | markdownify }}

Expected Output:

Actual Output:

Summary

kramdown does work in my blog post content. But it doesn't work anywhere else.

1

1 Answers

2
votes

The existing markdownify filter uses the same converter as the rest of your site.
The error however is in your front matter.

page_description: >
   **kramdown formated text**
   {: style="color: red"}

translates into '**kramdown formated text** {: style="color: red"}'

You need to use the pipe character (|) to let YAML respect newlines. So simply edit your front matter as following and you should get the expected output:

page_description: |
   **kramdown formated text**
   {: style="color: red"}