From 949c380235888ab376b4b6e6f2f1f057f926dd31 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sun, 13 May 2018 10:28:56 +0300 Subject: [PATCH] Update reply format again --- mautrix_telegram/formatter/from_telegram.py | 4 ++-- mautrix_telegram/formatter/util.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mautrix_telegram/formatter/from_telegram.py b/mautrix_telegram/formatter/from_telegram.py index 688cf85a..3e9992e4 100644 --- a/mautrix_telegram/formatter/from_telegram.py +++ b/mautrix_telegram/formatter/from_telegram.py @@ -92,7 +92,7 @@ async def _add_forward_header(source, text: str, html: Optional[str], text = "\n".join([f"> {line}" for line in text.split("\n")]) text = f"Forwarded from {fwd_from_text}:\n{text}" html = (f"Forwarded message from {fwd_from_html}
" - f"
{html}
") + f"
{html}
") return text, html @@ -155,7 +155,7 @@ async def _add_reply_header(source: u.User, text: str, html: str, evt: Message, r_keyword = "In reply to" if not is_edit else "Edit to" r_msg_link = f"{r_keyword}" - html = (f"
{r_msg_link} {r_sender_link}\n{r_html_body}
" + html = (f"
{r_msg_link} {r_sender_link}\n{r_html_body}
" + (html or escape(text))) lines = r_text_body.strip().split("\n") diff --git a/mautrix_telegram/formatter/util.py b/mautrix_telegram/formatter/util.py index 0073de52..f464ffe5 100644 --- a/mautrix_telegram/formatter/util.py +++ b/mautrix_telegram/formatter/util.py @@ -45,9 +45,9 @@ def trim_reply_fallback_text(text: str) -> str: return "\n".join(lines) -html_reply_fallback_regex = re.compile("^
" +html_reply_fallback_regex = re.compile("^" r"[\s\S]+?" - "
") + "") def trim_reply_fallback_html(html: str) -> str: