diff --git a/mautrix_telegram/formatter/from_telegram.py b/mautrix_telegram/formatter/from_telegram.py index 4e886a3c..688cf85a 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 3b91a527..0073de52 100644 --- a/mautrix_telegram/formatter/util.py +++ b/mautrix_telegram/formatter/util.py @@ -47,8 +47,7 @@ def trim_reply_fallback_text(text: str) -> str: html_reply_fallback_regex = re.compile("^
" r"[\s\S]+?" - "(
)?" - "") + "") def trim_reply_fallback_html(html: str) -> str: