Skip to content

Commit 47acbe3

Browse files
committed
Preprocess: rename fix_relative_link() to tranform_link()
1 parent 77ff943 commit 47acbe3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

commands/preprocess.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,11 @@ def trasform_relative_link(rename_map, target):
195195
target = target.replace('%23', '#')
196196
return target
197197

198-
# Transforms a relative link in the given file according to rename map.
198+
# Transforms a link in the given file according to rename map.
199199
# target is the link to transform.
200200
# file is the path of the file the link came from.
201201
# root is the path to the root of the archive.
202-
def fix_relative_link(rename_map, target, file, root):
202+
def transform_link(rename_map, target, file, root):
203203
if is_loader_link(target):
204204
return transform_loader_link(target, file, root)
205205

@@ -284,9 +284,9 @@ def preprocess_html_file(root, fn, rename_map):
284284
# apply changes to links caused by file renames
285285
for el in html.xpath('//*[@src or @href]'):
286286
if el.get('src') is not None:
287-
el.set('src', fix_relative_link(rename_map, el.get('src'), fn, root))
287+
el.set('src', transform_link(rename_map, el.get('src'), fn, root))
288288
elif el.get('href') is not None:
289-
el.set('href', fix_relative_link(rename_map, el.get('href'), fn, root))
289+
el.set('href', transform_link(rename_map, el.get('href'), fn, root))
290290

291291
for err in parser.error_log:
292292
print("HTML WARN: {0}".format(err))

0 commit comments

Comments
 (0)