少于1分钟
将以下英文翻译为中文:
https://gohugo.io/functions/anchorize/
Takes a string and sanitizes it the same way as the defaultMarkdownHandler
does for markdown headers.
anchorize INPUT
If Goldmark is set as defaultMarkdownHandler
, the sanitizing logic adheres to the setting markup.goldmark.parser.autoHeadingIDType
.
Since the defaultMarkdownHandler
and this template function use the same sanitizing logic, you can use the latter to determine the ID of a header for linking with anchor tags.
|
|