mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 13:27:47 +00:00
Cleaner markdown
This commit is contained in:
parent
dc47d8e386
commit
efeade88c1
@ -123,23 +123,20 @@ class Markdown:
|
|||||||
elif type == "pre":
|
elif type == "pre":
|
||||||
style = self.PRE_DELIMITER
|
style = self.PRE_DELIMITER
|
||||||
elif type == "text_link":
|
elif type == "text_link":
|
||||||
message = message[:start] + message[start:].replace(
|
|
||||||
sub, "[{}]({})".format(sub, url), 1
|
|
||||||
)
|
|
||||||
offset += 4 + len(url)
|
offset += 4 + len(url)
|
||||||
|
message = message[:start] + message[start:].replace(
|
||||||
|
sub, "[{}]({})".format(sub, url), 1)
|
||||||
continue
|
continue
|
||||||
elif type == "text_mention":
|
elif type == "text_mention":
|
||||||
message = message[:start] + message[start:].replace(
|
|
||||||
sub, "[{}](tg://user?id={})".format(sub, user.id), 1
|
|
||||||
)
|
|
||||||
offset += 17 + len(str(user.id))
|
offset += 17 + len(str(user.id))
|
||||||
|
message = message[:start] + message[start:].replace(
|
||||||
|
sub, "[{}](tg://user?id={})".format(sub, user.id), 1)
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
message = message[:start] + message[start:].replace(
|
|
||||||
sub, "{0}{1}{0}".format(style, sub), 1
|
|
||||||
)
|
|
||||||
offset += len(style) * 2
|
offset += len(style) * 2
|
||||||
|
message = message[:start] + message[start:].replace(
|
||||||
|
sub, "{0}{1}{0}".format(style, sub), 1)
|
||||||
|
|
||||||
return message
|
return message
|
||||||
|
Loading…
x
Reference in New Issue
Block a user