A Way to Compare Hugo's Markup Languages (Featuring Inline Footnotes in Blackfriday-, Goldmark-, Mmark-, and Pandoc-⁠Flavored Markdown)
Updated 2021-August-16

Page contents

News

2021-August-2  Published this evolving⁠[1] article.

Introduction

Thanks to Hugo’s RenderString function, which was introduced in Hugo v0.62.0, it is possible to use more than one of Hugo’s markup languages in the source of a single page. This means you can test features of Hugo’s markup languages without creating a separate file for each markup language.

 

Example comparison: Inline footnotes in different Markdown flavors

Some Markdown flavors support this syntax for inline footnotes:

some text^[This is an inline footnote.]

In the source of the four tests below, I use Infinite Ink’s renderas shortcode to test four of Hugo’s markup languages.

 

Test 1: Blackfriday-flavored Markdown

Source fragment

{{< renderas blackfriday >}}

some text^[This is an inline footnote.]

{{< /renderas >}}

 

Rendered in your web browser

some text1


  1. This is an inline footnote. [return]

 


Test 2: Goldmark-flavored Markdown

Source fragment

{{< renderas goldmark >}}

some text^[This is an inline footnote.]

{{< /renderas >}}

 

Rendered in your web browser

some text^[This is an inline footnote.]

 


Test 3: Mmark-flavored Markdown

Source fragment

{{< renderas mmark >}}

some text^[This is an inline footnote.]

{{< /renderas >}}

 

Rendered in your web browser

some text1


  1. This is an inline footnote. [return]

 


Test 4: Pandoc-flavored Markdown

Source fragment

{{< renderas pandoc >}}

some text^[This is an inline footnote.]

{{< /renderas >}}

 

Rendered in your web browser

some text1


  1. This is an inline footnote.↩︎

Conclusion

  • Blackfriday-, Mmark-, and Pandoc-⁠flavored Markdown support this inline footnote syntax.

  • Goldmark-flavored Markdown does not support this inline footnote syntax. It’s possible — but probably not likely — this will be supported in a future version of Goldmark.

 

As of Hugo v0.87.0, which was released 2021-August-3, both the Blackfriday and Mmark built-in Markdown renderers are deprecated.

 

See also

Endnote


1. Many Infinite Ink articles, including this one, are evergreen and regularly updated.

Comments 👍 👎 📝

Please comment so I know I'm not speaking into the void. Also, your public comment might improve this page or help me to improve this page.