From: Niki Roo Date: Mon, 19 Mar 2018 18:45:24 +0000 (+0100) Subject: Change: less \n in the listing if no content X-Git-Url: http://git.nikiroo.be/?p=gofetch.git;a=commitdiff_plain;h=75f6f0c263e88492d094fbdab1407a1fdee53056 Change: less \n in the listing if no content --- diff --git a/src/be/nikiroo/gofetch/output/Gopher.java b/src/be/nikiroo/gofetch/output/Gopher.java index 7120dfa..51da87f 100644 --- a/src/be/nikiroo/gofetch/output/Gopher.java +++ b/src/be/nikiroo/gofetch/output/Gopher.java @@ -118,6 +118,7 @@ public class Gopher extends Output { builder.append("\r\n"); appendJustified(builder, false, story.getFullContent(), " "); + builder.append("\r\n"); } else { builder.append('0').append(story.getTitle()) // .append('\t').append(story.getSelector()) // @@ -127,11 +128,13 @@ public class Gopher extends Output { appendJustified(builder, true, story.getDetails(), " "); builder.append("i\r\n"); - appendJustified(builder, true, story.getContent(), " "); + String content = story.getContent(); + if (!content.isEmpty()) { + appendJustified(builder, true, content, " "); + builder.append("i\r\n"); + } } - builder.append(resume ? "i" : "").append("\r\n"); - return builder; }