markdown.ex: Make suggestion(s) plural only if on >1
authorHaelwenn (lanodan) Monnier <contact@hacktivis.me>
Tue, 17 Sep 2019 20:22:54 +0000 (22:22 +0200)
committerHaelwenn (lanodan) Monnier <contact@hacktivis.me>
Tue, 17 Sep 2019 21:05:27 +0000 (23:05 +0200)
lib/pleroma/docs/markdown.ex

index 739e4fce3f24c51f3969ae25775de1df06c66b3d..fc6389064b4c558b34a0a59482e8a2c06c0e20b5 100644 (file)
@@ -73,13 +73,15 @@ defmodule Pleroma.Docs.Markdown do
   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