markdown.ex: Make suggestion(s) plural only if on >1

This commit is contained in:
Haelwenn (lanodan) Monnier 2019-09-17 22:22:54 +02:00
parent 32d64102cb
commit d6182a3c8f
No known key found for this signature in database
GPG Key ID: D5B7A8E43C997DEE
1 changed files with 4 additions and 2 deletions

View File

@ -73,13 +73,15 @@ defp print_suggestions(_file, nil), do: nil
defp print_suggestions(_file, ""), do: nil
defp print_suggestions(file, suggestions) do
IO.write(file, "Suggestions:\n")
if length(suggestions) > 1 do
IO.write(file, "Suggestions:\n")
for suggestion <- suggestions do
print_suggestion(file, suggestion, true)
end
else
IO.write(file, "Suggestion:\n")
print_suggestion(file, List.first(suggestions))
end
end