sync: automatically add   before ponctuation

This commit is contained in:
nemunaire 2018-12-09 23:59:20 +01:00
parent 0075bdeb52
commit 0d8505131e
3 changed files with 13 additions and 5 deletions

View file

@ -28,6 +28,8 @@ func SyncExerciceHints(i Importer, exercice fic.Exercice) (errs []string) {
for n, hint := range params.Hints {
if hint.Title != "" {
hint.Title = fmt.Sprintf("Astuce #%d", n+1)
} else {
hint.Title = fixnbsp(hint.Title)
}
if hint.Cost <= 0 {
hint.Cost = exercice.Gain / 4
@ -72,7 +74,7 @@ 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 if hint.Content, err = ProcessMarkdown(i, hint.Content, exercice.Path); err != nil{
} else if hint.Content, err = ProcessMarkdown(i, fixnbsp(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))
}