From df6162b54f6db7df99f92e9e68767b010a146175 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 9 Jun 2011 12:15:33 +0200 Subject: [PATCH] Only add a new plain-text part if there is any text in front of the link. --- src/main/java/net/pterodactylus/sone/text/SoneTextParser.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/pterodactylus/sone/text/SoneTextParser.java b/src/main/java/net/pterodactylus/sone/text/SoneTextParser.java index 2787d52..94c3db4 100644 --- a/src/main/java/net/pterodactylus/sone/text/SoneTextParser.java +++ b/src/main/java/net/pterodactylus/sone/text/SoneTextParser.java @@ -225,7 +225,9 @@ public class SoneTextParser implements Parser { if (!lastLineEmpty && lineComplete) { parts.add(new PlainTextPart("\n" + line.substring(0, next))); } else { - parts.add(new PlainTextPart(line.substring(0, next))); + if (next > 0) { + parts.add(new PlainTextPart(line.substring(0, next))); + } } String link = line.substring(next, nextSpace); String name = link; -- 2.7.4