Fix reply previews to blockquotes / codeblocks.

This commit is contained in:
John Preston 2024-09-04 14:45:35 +04:00
parent 1f4a8d7eb6
commit 5a2667c71e

View file

@ -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 {};