Fixed an url correction.

This commit is contained in:
The Wobbler 2025-04-10 10:40:01 +02:00
parent 15718aff6f
commit c8368d9b2f

6
omg.py
View file

@ -160,7 +160,7 @@ class OMG:
url = url.split()[0]
link = url.split("/")[-1].strip()
relpath = os.path.relpath(os.path.join(path, "../" + url), self.path).strip()
relpath = os.path.relpath(os.path.join(path, "../" + url.strip()), self.path)
if not relpath.endswith(".md"):
relpath += ".md"
@ -184,9 +184,9 @@ class OMG:
link = tokens[0].split("/")[-1].strip().replace("\\", "")
relpath = os.path.relpath(
os.path.join(path, "../" + tokens[0]),
os.path.join(path, "../" + tokens[0].strip().replace("\\", "")),
self.path
).strip().replace("\\", "")
)
if not relpath.endswith(".md"):
relpath += ".md"