ref: 5ee1f0876f3ec8b79d6305298185dc821ead2d28
parent: a82d2700fcc772aada15d65b8f76913ca23f7404
author: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
date: Sat Jan 4 18:58:23 EST 2020
markup/goldmark: Simplify code
--- a/markup/goldmark/autoid.go
+++ b/markup/goldmark/autoid.go
@@ -48,9 +48,9 @@
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:
}