Skip to content

Commit

Permalink
Fix pattern check
Browse files Browse the repository at this point in the history
  • Loading branch information
mjaehn committed Aug 15, 2024
1 parent 78d5a36 commit 7f9dc38
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/format_external_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ def modify_link(line):
general_replacement = r'[\1 ' + icon_external_link + r'](\2)'
download_replacement = r'[\1 ' + icon_download + r'](\2)'

if general_pattern in line:
# Check if the general pattern appears in the line
if re.search(general_pattern, line):
# Check for link icon
if icon_external_link not in line and icon_download not in line:
new_line = re.sub(download_pattern, download_replacement, line)
Expand Down

0 comments on commit 7f9dc38

Please sign in to comment.