Skip to content

Commit

Permalink
Fixed issue with incorrectly identifying unused images
Browse files Browse the repository at this point in the history
  • Loading branch information
kgodey committed Jan 20, 2022
1 parent 49149f1 commit a3af069
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions scripts/organize_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ def build_image_paths(img, files):
path = build_common_path(files)

name = os.path.basename(img)
# Remove styling
name = name.split(" ")[0]
# Remove styling from images with structure like "x.png =240x"
name = name.split(" =")[0]

save_path = os.path.join(path, name)
rel_path = path2rel(save_path)
Expand Down
4 changes: 2 additions & 2 deletions scripts/util/links.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ def resolve_wiki_link(link, file):
"""
Converts wiki.js link to usable local path
"""
# Remove styling that might be part of image links
link = link.split(" ")[0]
# Remove styling that might be part of image links (e.g. "x.png =240x")
link = link.split(" =")[0]
# Remove fragments if they exist
link = link.split("#")[0]
# Add .md extension is there is no extension
Expand Down

0 comments on commit a3af069

Please sign in to comment.