HTML Written Inside Markdown Not Showing Up in Hugo

HTML such as div and iframe is not being displayed

* This page contains promotional content

Symptoms

I had not written an article in Hugo for a while, and when I posted one after a long break I noticed that the iframes and HTML inside the Markdown were not being displayed.

Cause

When I looked into it, it turns out that with Goldmark, the Markdown parser newly adopted from Hugo v0.60, HTML tags inside Markdonw are ignored under the default settings

Solution

Since ignoring (stripping) HTML tags inside Markdonw is the default, it seems all you have to do is explicitly configure it not to ignore them

Add the following to config.toml under the Hugo root directory.

[markup.goldmark.renderer]
  unsafe = true

Depending on the theme the code above may already be included, and if it is there you do not need to add it.

By the way, in the YAML (confit.yml) format it is the following

markup:
  goldmark:
    renderer:
      unsafe: true

Reference articles

I used the articles below as a reference in solving this