From 997917cfe73ab2f48ecc9c4624ac64f1ce6474b9 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sun, 10 Nov 2024 16:44:04 +0300 Subject: Drop unused code --- src/main/java/com/juick/util/MessageUtils.java | 4 ---- src/test/java/com/juick/MessageTest.java | 7 ------- 2 files changed, 11 deletions(-) diff --git a/src/main/java/com/juick/util/MessageUtils.java b/src/main/java/com/juick/util/MessageUtils.java index ee6ff772..fff97f66 100644 --- a/src/main/java/com/juick/util/MessageUtils.java +++ b/src/main/java/com/juick/util/MessageUtils.java @@ -291,10 +291,6 @@ public class MessageUtils { return URLEncoder.encode(s, StandardCharsets.UTF_8).replace("+", "%20") .replace("*", "%2A").replace("%7E", "~"); } - public static String formatMarkdownText(final Message msg) { - return StringUtils.defaultString(msg.getText()) - .replaceAll(replyNumberRegex, String.format("$1[/$2](https://juick.com/m/%d#$2)$3", msg.getMid())); - } public static String attachmentUrl(final Message jmsg) { if (StringUtils.isEmpty(jmsg.getAttachmentType())) { return StringUtils.EMPTY; diff --git a/src/test/java/com/juick/MessageTest.java b/src/test/java/com/juick/MessageTest.java index e750f652..01eafe5c 100644 --- a/src/test/java/com/juick/MessageTest.java +++ b/src/test/java/com/juick/MessageTest.java @@ -164,13 +164,6 @@ public class MessageTest { assertThat(StringUtils.countMatches(MessageUtils.getTagsString(message), "*ab"), equalTo(1)); } @Test - public void markdownContentShouldNotHaveUnescapedReplyNumbersBecauseOfTelegram() { - Message msg = new Message(); - msg.setMid(1); - msg.setText("See /303 again"); - assertThat(MessageUtils.formatMarkdownText(msg), is("See [/303](https://juick.com/m/1#303) again")); - } - @Test public void shouldNotThrowIfUrlContainsIllegalCharacters() { String msg = "[te](http://juick.com/)[st](http://juick.com/)"; assertThat(MessageUtils.stripNonSafeUrls(msg), is(msg)); -- cgit v1.2.3