Skip to content
Permalink
Browse files

markup/goldmark: Simplify code

  • Loading branch information
bep committed Jan 4, 2020
1 parent a82d270 commit 5ee1f0876f3ec8b79d6305298185dc821ead2d28
Showing with 3 additions and 3 deletions.
  1. +3 −3 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:
}

0 comments on commit 5ee1f08

Please sign in to comment.
You can’t perform that action at this time.