Update anchorize.md

Tested with v0.95.0.
This commit is contained in:
Joe Mooring 2022-03-18 21:04:18 -07:00 committed by GitHub
parent 2ff0bd10b0
commit 48736447e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,11 +17,11 @@ If [Goldmark](https://gohugo.io/getting-started/configuration-markup#goldmark) i
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. 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.
``` ```go-html-template
{{anchorize "This is a header"}} → "this-is-a-header" {{ anchorize "This is a header" }} --> "this-is-a-header"
{{anchorize "This is also a header"}} → "this-is-also-a-header" {{ anchorize "This is also a header" }} --> "this-is-also----a-header"
{{anchorize "main.go"}} → "main-go" {{ anchorize "main.go" }} --> "maingo"
{{anchorize "Article 123"}} → "article-123" {{ anchorize "Article 123" }} --> "article-123"
{{anchorize "<- Let's try this, shall we?"}} "let-s-try-this-shall-we" {{ anchorize "<- Let's try this, shall we?" }} --> "--lets-try-this-shall-we"
{{anchorize "Hello, 世界"}} → "hello-世界" {{ anchorize "Hello, 世界" }} --> "hello-世界"
``` ```