From 6300623886102fa1cb26b6cf3ec2bdaa68e70da9 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Mon, 8 Aug 2022 16:21:16 +0200 Subject: [PATCH] Fix newlines in displaying telegram cards --- src/telegram/display.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/telegram/display.rs b/src/telegram/display.rs index 826ef30..c04b756 100644 --- a/src/telegram/display.rs +++ b/src/telegram/display.rs @@ -153,6 +153,9 @@ fn display_keywords(keywords: &[CardKeyword], hm: &LocalizedCardKeywordIndex) -> } +/// Render a [Card::localized_description_text] in [Telegram Bot HTML]. +/// +/// [Telegram Bot HTML]: https://core.telegram.org/bots/api#html-style fn display_description(description: &String) -> String { if description == "" { "".to_string() @@ -163,6 +166,9 @@ fn display_description(description: &String) -> String { } +/// Render a [Card::localized_levelup_text] in [Telegram Bot HTML]. +/// +/// [Telegram Bot HTML]: https://core.telegram.org/bots/api#html-style fn display_levelup(levelup: &String) -> String { if levelup == "" { "".to_string()