mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
markup/goldmark: Simplify code
This commit is contained in:
parent
a82d2700fc
commit
5ee1f0876f
1 changed files with 3 additions and 3 deletions
|
@ -48,9 +48,9 @@ func sanitizeAnchorNameWithHook(b []byte, asciiOnly bool, hook func(buf *bytes.B
|
||||||
r, size := utf8.DecodeRune(b)
|
r, size := utf8.DecodeRune(b)
|
||||||
switch {
|
switch {
|
||||||
case asciiOnly && size != 1:
|
case asciiOnly && size != 1:
|
||||||
case isSpace(r):
|
case r == '-' || isSpace(r):
|
||||||
buf.WriteString("-")
|
buf.WriteRune('-')
|
||||||
case r == '-' || isAlphaNumeric(r):
|
case isAlphaNumeric(r):
|
||||||
buf.WriteRune(unicode.ToLower(r))
|
buf.WriteRune(unicode.ToLower(r))
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue