Skip to content

Commit

Permalink
Merge pull request #107 from Lamroy95/master
Browse files Browse the repository at this point in the history
Add html quote
  • Loading branch information
bomzheg authored Apr 26, 2023
2 parents 7c53d1a + f9926c2 commit bfd2344
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/models/db/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ async def get_or_create_from_tg_chat(cls, chat):

@property
def mention(self):
return hd.link(self.title, f"t.me/{self.username}") if self.username else hd.quote(self.title)
return hd.link(hd.quote(self.title), f"t.me/{self.username}") if self.username else hd.quote(self.title)

def __str__(self):
rez = f"Chat with type: {self.type_} with ID {self.chat_id}, title: {self.title}"
Expand Down
4 changes: 2 additions & 2 deletions app/models/db/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ async def get_or_create_from_tg_user(cls, user_tg: types.User | dto.TargetUser):

@property
def mention_link(self):
return hd.link(self.fullname, f"tg://user?id={self.tg_id}")
return hd.link(hd.quote(self.fullname), f"tg://user?id={self.tg_id}")

@property
def mention_no_link(self):
if self.username:
rez = hd.link(self.fullname, f"t.me/{self.username}")
rez = hd.link(hd.quote(self.fullname), f"t.me/{self.username}")
else:
rez = hd.quote(self.fullname)
return rez
Expand Down

0 comments on commit bfd2344

Please sign in to comment.