From: David ‘Bombe’ Roden Date: Thu, 9 Jun 2011 10:15:33 +0000 (+0200) Subject: Only add a new plain-text part if there is any text in front of the link. X-Git-Tag: 0.6.5^2~8^2~3 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=df6162b54f6db7df99f92e9e68767b010a146175;p=Sone.git Only add a new plain-text part if there is any text in front of the link. --- 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;