From 5a2667c71e79574b9c35ab82c9d9e29afdf1d7aa Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 4 Sep 2024 14:45:35 +0400 Subject: [PATCH] Fix reply previews to blockquotes / codeblocks. --- Telegram/SourceFiles/history/history_item.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/history/history_item.cpp b/Telegram/SourceFiles/history/history_item.cpp index e0a96d7f6..004720dfd 100644 --- a/Telegram/SourceFiles/history/history_item.cpp +++ b/Telegram/SourceFiles/history/history_item.cpp @@ -3454,9 +3454,10 @@ ItemPreview HistoryItem::toPreview(ToPreviewOptions options) const { return _media->toPreview(options); } else if (!emptyText()) { return { - .text = st::wrap_rtl(options.translated - ? translatedText() - : _text) + // wrap_rtl "adds" a newline in case text starts with quote. + // So we remove those by DialogsPreviewText call. + .text = st::wrap_rtl(Dialogs::Ui::DialogsPreviewText( + options.translated ? translatedText() : _text)) }; } return {};