Commit aa066352 authored by ankraft's avatar ankraft
Browse files

Corrected wrong media paths

parent a09a45d3
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -129,14 +129,14 @@ def expandPaths(lines:list[str], currentPath:str, childPath:str) -> list[str]:
				continue

			# Skip email addresses
			if "@" in linkPath:
			if '@' in linkPath:
				continue
			
			# Construct the new path by adding addedPath to the original path
			newLinkPath = linkPath[2:] if linkPath.startswith('./') else linkPath
			
			# Create the updated path
			updatedPath = f"{newPath}{linkPath}" if newPath.endswith('/') else f"{newPath}/{newLinkPath}"
			updatedPath = f"{newPath}{linkPath}" if not newPath or newPath.endswith('/') else f"{newPath}/{newLinkPath}"
			
			# Replace the original link with the updated one in the markdown
			line = line.replace(f'[{linkText}]({linkPath})', f'[{linkText}]({updatedPath})')