mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-14 06:17:45 +00:00
markup/goldmark: Simplify code
This commit is contained in:
1 file changed
+3
-3
@@ -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:
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user