Embedding HTML in Markdown with Hugo
Recently, I made the switch from the deprecated markdown renderer, Blackfriday, to the default Hugo markdown renderer, Goldmark. While this transition had been long overdue, it came with a drawback - all the embedded HTML in my markdown files ceased to work.
However, I found a solution to this issue by enabling a specific option in my Hugo configuration file, whether it be config.yaml
or config.toml
. Here’s how to do it:
For config.yaml
:
1 | markup: |
For config.toml
:
1 | [markup.goldmark.renderer] |
By setting the unsafe
option to true
, I was able to regain the functionality of embedded HTML within my markdown files.
With this configuration, I can now seamlessly embed HTML code in my markdown content, enhancing the flexibility and richness of my Hugo-powered website.
Tags: Hugo, Goldmark, Markdown, HTML embedding