Skip to content

Commit dd64d04

Browse files
committed
chore(github): Change syntax and fix typing in convert_links method.
1 parent b32adb0 commit dd64d04

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bot/github/github_parsers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -601,9 +601,9 @@ def convert_links(x: str) -> str:
601601
:return: Formatted text.
602602
"""
603603
reg: str = r'\[([a-zA-Z0-9!@#$%^&*,./?\'";:_=~` ]+)\]\(([(http(s)?):\/\/(www\.)?a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b[-a-zA-Z0-9@:%_\+.~#?&//=]*)\)'
604-
gh_links: list[tuple(str)] = re.findall(reg, x)
604+
gh_links: list[tuple(str, str)] = re.findall(reg, x)
605605
for (txt, link) in gh_links:
606-
old: str = "[" + str(txt) + "]" + "(" + str(link) + ")"
606+
old: str = f"[{txt}]({link})"
607607
txt = str(txt).strip()
608608
link = str(link).strip()
609609
new: str = f"<{link}|{txt}>"

0 commit comments

Comments
 (0)