sync: Handle finished.md as alternative to finished.txt
This commit is contained in:
parent
2df227c25b
commit
4b09efa9fd
@ -184,9 +184,12 @@ func BuildExercice(i Importer, theme *fic.Theme, epath string, dmap *map[int64]*
|
||||
|
||||
if i.exists(path.Join(epath, "finished.txt")) {
|
||||
e.Finished, err = GetFileContent(i, path.Join(epath, "finished.txt"))
|
||||
} else if i.exists(path.Join(epath, "finished.md")) {
|
||||
e.Finished, err = GetFileContent(i, path.Join(epath, "finished.md"))
|
||||
}
|
||||
if err != nil {
|
||||
errs = append(errs, NewExerciceError(e, fmt.Errorf("finished.txt: %w", err), theme))
|
||||
} else {
|
||||
errs = append(errs, NewExerciceError(e, fmt.Errorf("finished.md: %w", err), theme))
|
||||
} else if len(e.Finished) > 0 {
|
||||
// Call checks hooks
|
||||
for _, h := range hooks.mdTextHooks {
|
||||
for _, err := range h(e.Finished, exceptions.GetFileExceptions("finished.md", "finished.txt")) {
|
||||
@ -195,8 +198,7 @@ func BuildExercice(i Importer, theme *fic.Theme, epath string, dmap *map[int64]*
|
||||
}
|
||||
|
||||
if e.Finished, err = ProcessMarkdown(i, e.Finished, epath); err != nil {
|
||||
errs = append(errs, NewExerciceError(e, fmt.Errorf("finished.txt: an error occurs during markdown formating: %w", err), theme))
|
||||
}
|
||||
errs = append(errs, NewExerciceError(e, fmt.Errorf("finished.md: an error occurs during markdown formating: %w", err), theme))
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user