GitHub does not consider tabs as delimiter, see https://github.com/bep/portable-hugo-links/blob/master/blog/p2.md
Closes #6710
r, size := utf8.DecodeRune(b)
switch {
case asciiOnly && size != 1:
- case r == '-' || isSpace(r):
+ case r == '-' || r == ' ':
buf.WriteRune('-')
case isAlphaNumeric(r):
buf.WriteRune(unicode.ToLower(r))
return r == '_' || unicode.IsLetter(r) || unicode.IsDigit(r)
}
-func isSpace(r rune) bool {
- return r == ' ' || r == '\t'
-}
-
var _ parser.IDs = (*idFactory)(nil)
type idFactory struct {
Forward/slash
Backward\slash
Under_score
+Nonbreaking Space
+Tab Space
`
expect := `
forwardslash
backwardslash
under_score
+nonbreakingspace
+tabspace
`
tests, expect = strings.TrimSpace(tests), strings.TrimSpace(expect)