repochecker: Check flag's help content through mdTextHooks

This commit is contained in:
nemunaire 2023-11-25 10:32:48 +01:00
parent 9896445e00
commit b52622c772
2 changed files with 8 additions and 3 deletions

View file

@ -351,6 +351,13 @@ func buildExerciceFlag(i Importer, exercice *fic.Exercice, flag ExerciceFlag, nl
}
if len(flag.Help) > 0 {
// Call checks hooks
for _, hk := range hooks.mdTextHooks {
for _, err := range multierr.Errors(hk(flag.Help, exercice.Language, exceptions)) {
errs = multierr.Append(errs, NewFlagError(exercice, &flag, nline+1, err))
}
}
if mdhelp, err := ProcessMarkdown(i, flag.Help, exercice.Path); err != nil {
errs = multierr.Append(errs, NewFlagError(exercice, &flag, nline+1, fmt.Errorf("unable to parse property help as Markdown: %w", err)))
} else {