grammalecte: Force capital letter only if first char is a letter

Fixes: https://gitlab.cri.epita.fr/ing/majeures/srs/fic/server/-/issues/34
This commit is contained in:
nemunaire 2023-11-24 12:16:17 +01:00
parent 130bb0c092
commit 9896445e00
1 changed files with 1 additions and 1 deletions

View File

@ -39,7 +39,7 @@ func GrammalecteCheckFlagChoice(choice *fic.FlagChoice, exercice *fic.Exercice,
errs = multierr.Append(errs, grammalecte("label ", choice.Label, -1, exceptions, &CommonOpts))
}
if len(multierr.Errors(errs)) == 0 && !unicode.IsUpper(bytes.Runes([]byte(choice.Label))[0]) && !exceptions.HasException(":label_majuscule") {
if len(multierr.Errors(errs)) == 0 && unicode.IsLetter(bytes.Runes([]byte(choice.Label))[0]) && !unicode.IsUpper(bytes.Runes([]byte(choice.Label))[0]) && !exceptions.HasException(":label_majuscule") {
errs = multierr.Append(errs, fmt.Errorf("%q nécessite une majuscule (:label_majuscule)", choice.Label))
}