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:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-01-05 01:58:23 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-01-05 01:58:23 +0300
commit5ee1f0876f3ec8b79d6305298185dc821ead2d28 (patch)
treede8689d4f84dbca7a82aeeffab0ad9640fe2336c /markup
parenta82d2700fcc772aada15d65b8f76913ca23f7404 (diff)
markup/goldmark: Simplify code
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:
}