Use concatenation with f-strings in parantheses for future-fstrings compatibility

This commit is contained in:
Tulir Asokan
2018-01-29 19:38:19 +02:00
parent bef850e924
commit 63070624f6
3 changed files with 15 additions and 14 deletions
+3 -3
View File
@@ -214,7 +214,7 @@ def telegram_event_to_matrix(evt, source):
if not fwd_from:
fwd_from = "Unknown user"
html = (f"Forwarded message from <b>{fwd_from}</b><br/>"
f"<blockquote>{html}</blockquote>")
+ f"<blockquote>{html}</blockquote>")
if evt.reply_to_msg_id:
msg = DBMessage.query.get((evt.reply_to_msg_id, source.tgid))
@@ -261,8 +261,8 @@ def _telegram_to_matrix(text, entities):
elif entity_type == MessageEntityPre:
if entity.language:
html.append("<pre>"
f"<code class='language-{entity.language}'>{entity_text}</code>"
"</pre>")
+ f"<code class='language-{entity.language}'>{entity_text}</code>"
+ "</pre>")
else:
html.append(f"<pre><code>{entity_text}</code></pre>")
elif entity_type == MessageEntityMention: