Skip to content

Commit

Permalink
modify the condition of the first character so that any characters in…
Browse files Browse the repository at this point in the history
… category L without lower case characters are valid #15
  • Loading branch information
inatus committed Feb 27, 2014
1 parent 85989cd commit d7d32fe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/pkg/go/doc/comment.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ func heading(line string) string {

// a heading must start with an uppercase letter
r, _ := utf8.DecodeRuneInString(line)
if !unicode.IsLetter(r) || !unicode.IsUpper(r) {
if !unicode.IsLetter(r) || unicode.IsLower(r) {
return ""
}

Expand Down
7 changes: 7 additions & 0 deletions src/pkg/go/doc/comment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ var headingTests = []struct {
{"Use n+m", false},
{"Scanning:", false},
{"N:M", false},
{"これはヘッダです", true},
{"これはヘッダではありません。", false},
{"コレも、ヘッダではないです", false},
{"ヘッダです", true},
{"此れもヘッダでないです。", false},
{"此れはヘッダで須", true},
{"これはヘッダでない!", false},
}

func TestIsHeading(t *testing.T) {
Expand Down

0 comments on commit d7d32fe

Please sign in to comment.