Only add a new plain-text part if there is any text in front of the link.
[Sone.git] / src / main / java / net / pterodactylus / sone / text / SoneTextParser.java
index 2787d52..94c3db4 100644 (file)
@@ -225,7 +225,9 @@ public class SoneTextParser implements Parser<SoneTextParserContext> {
                                        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;