ignoreLogs = ['warning-goldmark-raw-html']

I recently updated Hugo to version v0.138.0-ad82998d54b3f9f8c2741b67356813b55b3134b9+extended windows/amd64 BuildDate=2024-11-06T11:22:34Z. Since the update, I have been encountering the following warning for every Markdown file in my content repository:

WARN  Raw HTML omitted from "xxxxxxxx.md"; see https://gohugo.io/getting-started/configuration-markup/#rendererunsafe

To suppress this warning, I followed the official guidance and added the following line to my hugo.toml file:

ignoreLogs = ['warning-goldmark-raw-html']

However, the warning persists and continues to appear during development, which also causes a delay in reflecting changes.

Has anyone else experienced this issue or found a solution to prevent this warning from recurring? Any help or insights would be greatly appreciated!

i cannot reproduce the problem with v0.138.0 extended on Windows

ignoreLogs is a toplevel key and must be added before any table

please recheck your config. If you cannot solve please post the entire file.

hugo new theme --themesDir . topic-52469
cd topic-52469
edit content/_index.html
+++
title = 'Home'
date = 2023-01-01T08:00:00-07:00
draft = false
+++

<h1>Some raw HTML in Markdown</h1>

Laborum voluptate pariatur ex culpa magna nostrud est incididunt fugiat pariatur do dolor ipsum enim. Consequat tempor
do dolor eu. Non id id anim anim excepteur excepteur pariatur nostrud qui irure ullamco.

hugo outputs:

Start building sites …
hugo v0.138.0-ad82998d54b3f9f8c2741b67356813b55b3134b9+extended windows/amd64 BuildDate=2024-11-06T11:22:34Z VendorInfo=gohugoio

WARN  Raw HTML omitted from "C:/_repos/github/clone/topic-52469/content/_index.md"; see https://gohugo.io/getting-started/configuration-markup/#rendererunsafe
You can suppress this warning by adding the following to your site configuration:
ignoreLogs = ['warning-goldmark-raw-html']

                   | EN
-------------------+-----
  Pages            | 18

add ignoreLogs
baseURL = 'https://example.org/'
languageCode = 'en-US'
title = 'My New Hugo Site'

ignoreLogs = [ 'warning-goldmark-raw-html' ]

[[menus.main]]
name = 'Home'
pageRef = '/'
weight = 10

[[menus.main]]
name = 'Posts'
pageRef = '/posts'
weight = 20

[[menus.main]]
name = 'Tags'
pageRef = '/tags'
weight = 30

[module]
  [module.hugoVersion]
    extended = false
    min = "0.116.0"

hugo outputs:

Start building sites …
hugo v0.138.0-ad82998d54b3f9f8c2741b67356813b55b3134b9+extended windows/amd64 BuildDate=2024-11-06T11:22:34Z VendorInfo=gohugoio


                   | EN
-------------------+-----
  Pages            | 18

unsafe setting

if you need the html markup and set unsafe to true the warning won’t show up regardless of the ignoreLogs setting

[markup]
   [markup.goldmark]
      [markup.goldmark.renderer]
         unsafe = true
2 Likes

A tip would be to do hugo config and see what the effective setting is, if on *nix you can do:

hugo config | grep ignorelogs

Thank you! I placed it on top, and the warnings disappeared, but unfortunately, the delay persists. I’ll try restoring the old version if I get some time to mess around. If I do, I’ll come back. :slight_smile:

Thanks a lot for saving my day!!

Unfortunately (or fortunately), I’m not on *nix. I’ve always stuck with the mouse since the beginning. :))"

For that I think we would need a repo where it is reproducable and comparable …so the geeks :wink: could dive in.

And a new topic for it

there is ofc some natural delay:

I have a 5000 one pager with one html heading in each md

  1. suppressed warnings, unsafe=false
    around 1.3 sec
  2. unsuppressed warnings, unsafe=false
    around 1.4 sec
  3. unsafe = true (no warnings issued)
    around 1.5 sec

all explainable

  • 1 → 2 logging takes time (especially console)
  • 1 → 3 rendering the HTML needs additional actions which should be slower than just skipping it.

Sure, but then I suggest you try hugo config and look for the ignorelogs line and see what it says.

1 Like

powershell

hugo config | select-string ignorelogs

cmd

hugo config | findstr "ignorelogs"

If this were happening to me, I would want to understand why Hugo is emitting these warnings before choosing to suppress them.

https://discourse.gohugo.io/t/warning-when-mixing-html-and-markdown/52280

My car warns me when I forget to put on my seat belt. Ignoring that warning isn’t a great idea.

3 Likes

I understand that a few seconds of load time are reasonable, but I am encountering a notable performance bottleneck. My site currently comprises around 250 markdown files, with a growth rate of approximately 20 new markdown files per day.

The initial local server launch takes anywhere from 2 to 5 minutes, which seems disproportionate for a site of this scale. Additionally, when using Netlify CMS to add content, it takes approximately a minute for the new changes to be reflected.

The primary unique configuration in my setup involves the use of multiple markdown widgets in the frontmatter for rich text formatting. I then render these elements on the page using {{ . | markdownify }}.

By default, does using markdown widgets in the frontmatter pose a performance issue in Hugo? I ask because my setup involves multiple markdown widgets within the frontmatter inaddition of the body.

I have managed to suppress the warnings in the log by repositioning them at the top. However, the delay issue persists.

Here is my single.html layout for reference. You can view the live site at https://globalcommons.onrender.com/. Notice that I am using two markdown widgets within it:
<p>{{ .Params.prelude | markdownify }}</p> and {{ .Content }}.

<div id=maincontent class=dcr-1bwys2b>
                                <div class="article-body-commercial-selector article-body-viewer-selector dcr-1s4kg95">

                                    

                                    {{ $currentSection := .Section }}
                                        {{ $allRelatedPosts := where .Site.RegularPages "Section" $currentSection | first 3 }}
                                        {{ $relatedPosts := where $allRelatedPosts "Permalink" "!=" .Permalink }}
                                        
                                        {{ $p1 := index $relatedPosts 0 }}

                                        
                                        <!-- Insert the first related content component -->
                                        <figure id=9424e4d4-786e-46ba-bdd8-8e7db27ff44d class=dcr-1your1i>
                                            <gu-island>
                                                <div class=dcr-1kyw41h>
                                                    <div class=dcr-1idno2a>
                                                        <a href="{{ $p1.Permalink }}" class=dcr-1m887w9>
                                                            <div class=dcr-1lhuo3r></div>
                                                            <div>
                                                                <img style="" alt="{{ $p1.Title }}" title="{{ $p1.Title }}" src="{{ with $p1.Params.featured }}{{ . }}{{ else }}/images/svg/og.svg{{ end }}" class="dcr-1e3yjba">
                                                                <div class=dcr-ut4tvs>
                                                                    <div class=dcr-1h5b6rb>
                                                                        <div class="dcr-1dgt1gs posthead">{{ $p1.Title }}</div>
                                                                    </div>
                                                                    <div class=dcr-eurq8n>
                                                                        <svg width=24 height=24 viewBox="0 0 24 24">
                                                                            <g fill-rule=evenodd>
                                                                                <path d="m12 0c-6.627 0-12 5.373-12 12 0 6.627 5.373 12 12 12 6.627 0 12-5.373 12-12 0-6.627-5.373-12-12-12m.21 19l-.637-.668 4.888-6.326h-11.465v-1.01h11.465l-4.888-6.333.637-.668 6.79 7.158v.685l-6.79 7.157" class=rich-link__arrow-icon></path>
                                                                            </g>
                                                                        </svg>
                                                                        <div class="dcr-fkf7vq subject">Read more</div>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </a>
                                                    </div>
                                                </div>
                                            </gu-island>
                                        </figure>


                                        <div class="cmsbdy">
                                            <p>{{ .Params.prelude | markdownify }}</p>
                                        </div>
                                                                               
                                        {{ $p1 := index $relatedPosts 1 }}

                                        
                                        <!-- Insert the first related content component -->
                                        <figure id=9424e4d4-786e-46ba-bdd8-8e7db27ff44d class=dcr-1your1i>
                                            <gu-island>
                                                <div class=dcr-1kyw41h>
                                                    <div class=dcr-1idno2a>
                                                        <a href="{{ $p1.Permalink }}" class=dcr-1m887w9>
                                                            <div class=dcr-1lhuo3r></div>
                                                            <div>
                                                                <img style="" alt="{{ $p1.Title }}" title="{{ $p1.Title }}" src="{{ with $p1.Params.featured }}{{ . }}{{ else }}/images/svg/og.svg{{ end }}" class="dcr-1e3yjba">
                                                                <div class=dcr-ut4tvs>
                                                                    <div class=dcr-1h5b6rb>
                                                                        <div class="dcr-1dgt1gs posthead">{{ $p1.Title }}</div>
                                                                    </div>
                                                                    <div class=dcr-eurq8n>
                                                                        <svg width=24 height=24 viewBox="0 0 24 24">
                                                                            <g fill-rule=evenodd>
                                                                                <path d="m12 0c-6.627 0-12 5.373-12 12 0 6.627 5.373 12 12 12 6.627 0 12-5.373 12-12 0-6.627-5.373-12-12-12m.21 19l-.637-.668 4.888-6.326h-11.465v-1.01h11.465l-4.888-6.333.637-.668 6.79 7.158v.685l-6.79 7.157" class=rich-link__arrow-icon></path>
                                                                            </g>
                                                                        </svg>
                                                                        <div class="dcr-fkf7vq subject">Read more</div>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </a>
                                                    </div>
                                                </div>
                                            </gu-island>
                                        </figure>                                    

                                       

                                        
                                        <section class="adblock">
                                            <ins class="adsbygoogle"
                                            style="display:block"
                                            data-ad-format="fluid"
                                            data-ad-layout-key="-fb+5w+4e-db+86"
                                            data-ad-client="ca-pub-1969134809400225"
                                            data-ad-slot="2712462316"></ins>
    
                                        <div id="container-0c912f116986334257be391e4ef0996b"></div>
                                        </section>


 
                                        <div class="cmsbdy">
                                            {{ .Content }}
                                        </div>   
                                      

                                    
                                    

                                    
                                    
                                    
                                    <!-- <p class="dcr-1eu361v description"><em>Contributed reporting</em></p> -->
                                </div>
                            </div>
                            

What’s a “markdown widget”?

Something from Netlify CMS config.

      - { name: "prelude", label: "Prelude", widget: "markdown", required: false }    
      - { name: "body", label: "Body", widget: "markdown", required: false }

Based on what you have told us so far, no.

First, I notice you are a Windows user. See:
https://gohugo.io/troubleshooting/performance/#virus-scanning

Second, take a look at the rendering details:
https://gohugo.io/troubleshooting/performance/#template-metrics

Third, although this won’t have a material impact on performance, you can reduce this:

To this:

{{ $relatedPosts := where .FirstSection.RegularPagesRecursive "Path" "ne" .Path | first 3 }}

The above also ensures that you will always have 3 related pages. Your existing code returns either 2 or 3 pages.

Finally, use .Page.RenderString instead of markdownify to avoid the problems described in Issue #9692.

Thank you for the refactor. I’m currently using it. Regarding the logs, I reverted to v0.136.2 and removed the log suppression line from the toml file. Everything is now functioning as expected, just as it was before.

# Basic site configuration
baseURL = "https://globalcommons.onrender.com/"
languageCode = "en"
title = "Global News Headlines & Breaking Stories - TGC News"
theme = "gar"

[params]
  description = "Stay updated with top global news, breaking stories, politics, business, sports, and more | The Global Commons News."
  author = "The Global Commons News"
  sitemap_include_default = true

# Directory configurations
contentDir = "content"
staticDir = "static"
dataDir = "data"

# Permalink configurations
[permalinks]
  post = "/:year/:month/:day/:slug/"

# Enable or disable features
[markup]
  [markup.highlight]
    noClasses = false 
  [markup.goldmark]
    unsafe = true 
    
# Taxonomies
[taxonomies]
  tag = "tags"
  category = "categories"

# Output formats
[outputs]
  home = [ "HTML", "RSS", "JSON" ]

# Define JSON output format
[outputFormats]
  [outputFormats.JSON]
    mediaType = "application/json"
    baseName = "index"
    rel = "index"

# Disqus integration for comments
[services]
  [services.disqus]
    shortname = "xxxxxxx"

[sitemap]
  changeFreq = ""
  disable = false
  filename = "sitemap.xml"
  priority = 0.5
  exclude = ["categories", "tags"]  

31 seconds to build 350 pages with no image processing? Something is very wrong here.

I suggest you share your project repository, privately if you wish. Otherwise we’re just guessing.

I have a lot of such warnings because my site has articles on JavaScript and HTML, and some articles have headers like

## `<div>` tag definition

etc.; and some shortcodes even output unsafe unescaped <div> which I fixed recently. Check your content; I assume some HTMLs are malformed.

1 Like

as you can see, even here (see my message above) it didn’t output inline:

```
## `<div>` tag definition
```