From 2553895300bfccf9b9e593acb034e4a679feacd1 Mon Sep 17 00:00:00 2001 From: Millesimus Date: Sat, 11 Dec 2021 15:53:53 +0100 Subject: [PATCH] Fix #4249. --- .../java/eu/siacs/conversations/ui/util/QuoteHelper.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/ui/util/QuoteHelper.java b/src/main/java/eu/siacs/conversations/ui/util/QuoteHelper.java index 4beee8a22..cf49be767 100644 --- a/src/main/java/eu/siacs/conversations/ui/util/QuoteHelper.java +++ b/src/main/java/eu/siacs/conversations/ui/util/QuoteHelper.java @@ -30,14 +30,18 @@ public class QuoteHelper { } public static boolean isPositionAltQuoteStart(CharSequence body, int pos) { - return isPositionAltQuoteCharacter(body, pos) && !isPositionFollowedByAltQuoteEnd(body, pos); + return isPositionAltQuoteCharacter(body, pos) + && isPositionPrecededByPreQuote(body, pos) + && !isPositionFollowedByAltQuoteEnd(body, pos); } public static boolean isPositionFollowedByQuoteChar(CharSequence body, int pos) { return body.length() > pos + 1 && isPositionQuoteCharacter(body, pos + 1); } - // 'Prequote' means anything we require or can accept in front of a QuoteChar + /** + * 'Prequote' means anything we require or can accept in front of a QuoteChar. + */ public static boolean isPositionPrecededByPreQuote(CharSequence body, int pos) { return UIHelper.isPositionPrecededByLineStart(body, pos); }