From 75f6f0c263e88492d094fbdab1407a1fdee53056 Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Mon, 19 Mar 2018 19:45:24 +0100 Subject: [PATCH] Change: less \n in the listing if no content --- src/be/nikiroo/gofetch/output/Gopher.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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; } -- 2.27.0