From f3beba50c66473b89594743c7e790e49fd4d9ad9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 27 Nov 2010 11:27:54 +0100 Subject: [PATCH] =?utf8?q?Strip=20=E2=80=9Cfreenet:=E2=80=9D=20prefix=20fr?= =?utf8?q?om=20links.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/java/net/pterodactylus/sone/text/FreenetLinkParser.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/net/pterodactylus/sone/text/FreenetLinkParser.java b/src/main/java/net/pterodactylus/sone/text/FreenetLinkParser.java index 34edc48..85bda1a 100644 --- a/src/main/java/net/pterodactylus/sone/text/FreenetLinkParser.java +++ b/src/main/java/net/pterodactylus/sone/text/FreenetLinkParser.java @@ -117,6 +117,10 @@ public class FreenetLinkParser implements Parser { next = nextUsk; linkType = LinkType.USK; } + if ((next >= 8) && (line.substring(next - 8, next).equals("freenet:"))) { + next -= 8; + line = line.substring(0, next) + line.substring(next + 8); + } Matcher matcher = whitespacePattern.matcher(line); int nextSpace = matcher.find(next) ? matcher.start() : line.length(); if (nextSpace > (next + 4)) { -- 2.7.4