sync: refactor exercice synchronization

This commit is contained in:
nemunaire 2018-12-05 05:02:27 +01:00
parent 5b53fbda0b
commit dc4a4925e3
5 changed files with 254 additions and 151 deletions

View file

@ -72,8 +72,8 @@ func SyncExerciceHints(i Importer, exercice fic.Exercice) (errs []string) {
} else if hint.Content == "" {
errs = append(errs, fmt.Sprintf("%q: challenge.txt: hint %s (%d): content and filename can't be empty at the same time", path.Base(exercice.Path), hint.Title, n+1))
continue
} else {
hint.Content = ProcessMarkdown(i, hint.Content, exercice.Path)
} else if hint.Content, err = ProcessMarkdown(i, hint.Content, exercice.Path); err != nil{
errs = append(errs, fmt.Sprintf("%q: challenge.txt: hint %s (%d): error during markdown formating: %s", path.Base(exercice.Path), hint.Title, n+1, err))
}
// Import hint