From 0e2aab26f08a6ec4f187c1a845d0a9b0e8f4bf99 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 2 Feb 2024 14:25:46 +0300 Subject: Use
tag for quotes * fix compatibility with Mastodon --- src/main/assets/style.css | 5 ++--- src/main/java/com/juick/util/MessageUtils.java | 4 ++-- src/test/java/com/juick/MessageTest.java | 6 +++--- 3 files changed, 7 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/main/assets/style.css b/src/main/assets/style.css index e8ddad56..2a5d5a61 100644 --- a/src/main/assets/style.css +++ b/src/main/assets/style.css @@ -584,11 +584,10 @@ article .tags > a::before, /* #region user-generated texts */ -q:before, -q:after { +blockquote:before, +blockquote:after { content: ""; } -q, blockquote { border-left: 3px solid #CCC; color: #666; diff --git a/src/main/java/com/juick/util/MessageUtils.java b/src/main/java/com/juick/util/MessageUtils.java index ff0641ae..a4407f17 100644 --- a/src/main/java/com/juick/util/MessageUtils.java +++ b/src/main/java/com/juick/util/MessageUtils.java @@ -228,8 +228,8 @@ public class MessageUtils { if (!compatibleWithDurov) { // > citate - msg = msg.replaceAll(citateRegex, "$1"); - msg = msg.replaceAll("", "\n"); + msg = msg.replaceAll(citateRegex, "
$1
"); + msg = msg.replaceAll("
", "\n"); msg = msg.replaceAll("\n", "
\n"); } diff --git a/src/test/java/com/juick/MessageTest.java b/src/test/java/com/juick/MessageTest.java index c4aae8d5..14d6175a 100644 --- a/src/test/java/com/juick/MessageTest.java +++ b/src/test/java/com/juick/MessageTest.java @@ -210,7 +210,7 @@ public class MessageTest { @Test public void messageFormatTest() { String msg = "> quote\nmessage"; - assertThat(MessageUtils.formatMessage(msg), is("quotemessage")); + assertThat(MessageUtils.formatMessage(msg), is("
quote
message")); String brokenComment = "