sync: Allow Markdown in flag help

This commit is contained in:
nemunaire 2022-01-21 08:45:07 +01:00
parent 5a79343af8
commit 252ff33b83
3 changed files with 10 additions and 2 deletions

View file

@ -265,6 +265,14 @@ func buildExerciceFlag(i Importer, exercice *fic.Exercice, flag ExerciceFlag, nl
}
}
if len(flag.Help) > 0 {
if mdhelp, err := ProcessMarkdown(i, flag.Help, exercice.Path); err != nil {
errs = append(errs, fmt.Sprintf("%q: flag #%d: unable to parse property help as Markdown: %s", path.Base(exercice.Path), nline+1), err.Error())
} else {
flag.Help = mdhelp[3 : len(mdhelp)-4]
}
}
if flag.Type == "key" || strings.HasPrefix(flag.Type, "number") || flag.Type == "text" || flag.Type == "ucq" || flag.Type == "radio" || flag.Type == "vector" {
addedFlag, choices, berrs := buildKeyFlag(exercice, flag, nline+1, "Flag")
if len(berrs) > 0 {