Missing paragraphs adjacent to display maths

I have a small site generated with Hugo which custom layouts & css, i.e. no theme, and everything was working perfectly on my laptop under v0.127.0.

I just migrated to a new PC and now, under v0.143.1, sentences / paragraphs that are immediately adjacent to display math are omitted completely from the generated HTML. If I put an empty line between them and the maths, they do appear. So for example

This sentence will not appear
$$y = mx + c$$

But this one will

Additionally any <div>s which are directly adjacent to display math or adjacent to paragraphs which themselves are adjacent to display math are omitted.

All the layouts, templates, css, etc is identical between the two cases.

I had a quick look at the recent changelog but could not see anything immediately relevant (but then I’m not 100% sure I’d know what would be relevant).

Could someone help me diagnose & fix the problem please?

Thanks!
Dan

Is the rendering of mathematical markup local (i.e., using transform.ToMath) or client-side with MathJax/KaTeX?

I’m using MathJax (In fact, I wasn’t aware of transform.ToMath until you just mentioned it.)

I can easily reproduce the problem, and am looking into it. Until this is fixed, separate with a blank line as you mentioned:

This sentence will appear.

$$y = mx + c$$

So will this.

Notes:

See upstream issue:
https://github.com/gohugoio/hugo-goldmark-extensions/issues/32

Thanks for quickly identifying the problem!

I’ll wait for a fix because I don’t want to have to go back and edit all my old pages, but from now on I’ll try to remember to put a blank line.

I would go back and edit the old pages instead.