Hugo / Markdown questions

What’s the best way to stop an markdown image code from being wrapped in p tags?

Maybe I haven’t used markdown much in the last few years, but I honestly can’t remember images being wrapped in p tags before now. Google brought up a lot of cases, and said to use a div. But if I’m deploying a tool to writers, I’d like for them not to have to write html inside content if at all possible. It’s hard enough to convince people to understand/use a static site generator that aren’t extremely technical.

Also, what is the reasoning behind Goldmark applying ID’s to heading tags by default? Am I missing something here? I can think of far fewer cases where I would want that switched on than off. I understand that I have the power to add autoHeadingID = false, I’m just curious as to what it is even for?

Thanks.

  • That has always been the default setting, so it felt natural to keep that setting as the default when we added Goldmark.
  • The main reason (at least for me) it’s there is that they provide anchor links for the table of contents.
1 Like