Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
zakkarry committed Aug 26, 2024
1 parent 5a6d99a commit 71933fa
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions deluge/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -720,16 +720,9 @@ def parse_human_size(size):
raise InvalidSize(msg % (size, tokens))


def wrap_url_with_html(text):
def anchorify_urls(text: str) -> str:
"""
A simple regex sub to wrap all occurrences of URLs with HTML
Args:
text (str): The string to replace urls in.
Returns:
str: string with urls formatted as links (html).
Wrap all occurrences of text URLs with HTML
"""
url_pattern = r'((htt)|(ft)|(ud))ps?://\S+'
html_href_pattern = r'<a href="\g<0>">\g<0></a>'
Expand Down

0 comments on commit 71933fa

Please sign in to comment.