Add replace to work with Win

This commit is contained in:
Kiryl
2021-09-08 15:59:19 +03:00
parent 53d43dd061
commit 292ea98b12
3 changed files with 5 additions and 4 deletions

View File

@@ -37,7 +37,7 @@ def update_src_links_in_images(body_tag: Tag,
for img in img_tags:
path_to_img_from_html = img.attrs.get('src')
html_folder = os.path.dirname(path_to_html)
path_to_img_from_root = os.path.normpath(os.path.join(html_folder, path_to_img_from_html))
path_to_img_from_root = os.path.normpath(os.path.join(html_folder, path_to_img_from_html)).replace('\\', '/')
assert path_to_img_from_root in href2img_content, \
f'Image {path_to_img_from_html} in file {path_to_html} was not added to manifest.'