跳转至

Hugo 不解析 markdown 中的 html 标签

在 Hugo 中的 markdown 语法中插入 html 时候发现插入的 html 无法解析,但是标准 Markdown 语法仍然有效。

  • 无效:
<a href="baidu.com">百度</a>
  • 有效:
[Link to Google](https://www.google.com)

最佳答案

Hugo >=0.60 现在使用 Goldmark (见 https://gohugo.io/news/0.60.0-relnotes/),所以为了在 Markdown 文件中使用 html 标签,你应该在您的 config.toml 文件中添加:

[markup.goldmark.renderer]
unsafe = true

关于 R - Blogdown 和 Hugo 不解析 markdown 中的 html 标签,在 Stack Overflow 上找到一个类似的问题: https://stackoverflow.com/questions/60329235/ image