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="">

Some more text

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

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

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


Thanks @alexandros that’s it !

I’m using hugo 0.62.0 with Goldmark by default.

I’ve added this code to config.toml :

          unsafe = true
1 Like