Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/markup
diff options
context:
space:
mode:
Diffstat (limited to 'markup')
-rw-r--r--markup/goldmark/autoid.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/markup/goldmark/autoid.go b/markup/goldmark/autoid.go
index 6599f08d9..c064a76b3 100644
--- a/markup/goldmark/autoid.go
+++ b/markup/goldmark/autoid.go
@@ -48,9 +48,9 @@ func sanitizeAnchorNameWithHook(b []byte, asciiOnly bool, hook func(buf *bytes.B
r, size := utf8.DecodeRune(b)
switch {
case asciiOnly && size != 1:
- case isSpace(r):
- buf.WriteString("-")
- case r == '-' || isAlphaNumeric(r):
+ case r == '-' || isSpace(r):
+ buf.WriteRune('-')
+ case isAlphaNumeric(r):
buf.WriteRune(unicode.ToLower(r))
default:
}