Skip to content

Commit ee021f7

Browse files
committed
Preprocess: Match FTP external links
1 parent 124c8bd commit ee021f7

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

preprocess.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,14 @@ def find_html_files(root):
161161
return html_files
162162

163163
def fix_relative_link(rename_map, target):
164-
if 'http://' in target or 'https://' in target:
165-
return target
164+
external_link_patterns = [
165+
'http://',
166+
'https://',
167+
'ftp://'
168+
]
169+
for pattern in external_link_patterns:
170+
if pattern in target:
171+
return target
166172

167173
target = urllib.parse.unquote(target)
168174
for dir,fn,new_fn in rename_map:

0 commit comments

Comments
 (0)