This commit is contained in:
carlospolop 2025-07-18 15:04:10 +02:00
parent 0b873d5c5c
commit 90eea0973c

View File

@ -50,6 +50,7 @@ def ref(matchobj):
pass #nDont stop on broken link pass #nDont stop on broken link
else: else:
try: try:
href = href.replace("`", "") # Prevent hrefs like: ../../generic-methodologies-and-resources/pentesting-network/`spoofing-llmnr-nbt-ns-mdns-dns-and-wpad-and-relay-attacks.md`
if href.endswith("/"): if href.endswith("/"):
href = href+"README.md" # Fix if ref points to a folder href = href+"README.md" # Fix if ref points to a folder
if "#" in href: if "#" in href:
@ -74,7 +75,7 @@ def ref(matchobj):
logger.debug(f'Recursive title search result: {chapter["name"]}') logger.debug(f'Recursive title search result: {chapter["name"]}')
except Exception as e: except Exception as e:
logger.debug(e) logger.debug(e)
logger.error(f'Error getting chapter title: {path.normpath(path.join(dir,href))}') logger.error(f'Error getting chapter title: {path.normpath(path.join(dir,Error getting chapter title))}')
sys.exit(1) sys.exit(1)