Netlify build deletes custom html from md files

Hello !

I’ve developed my local website using hugo.
In my .md files I use paragraphs, shortcodes and custom html :

{{< figure src="image1.png" >}}

Some text

<div class="device desktop">
  <img src="image2.jpg" alt="">
</div>

Some more text

When deploying it on netlify using command hugo --gc --minify --baseURL https://myurl.netlify.com,
the following custom html is deleted :

<div class="device desktop">
  <img src="image2.jpg" alt="">
</div>

Though it’s present when building locally and when using local server

What could be the issue ?

Thanks !

What are the Hugo versions used locally and on Netlify?
What is the Markdown processor used?

Is it Goldmark (the new default in Hugo versions greater than 0.60.x)?
If the answer to the latter is yes see: Hugo 0.60.0 Raw HTML omitted Issue

2 Likes

Thanks @alexandros that’s it !

I’m using hugo 0.62.0 with Goldmark by default.

I’ve added this code to config.toml :

    [markup]
      [markup.goldmark]
        [markup.goldmark.renderer]
          unsafe = true
1 Like