Fixed an url correction.
This commit is contained in:
parent
15718aff6f
commit
c8368d9b2f
1 changed files with 3 additions and 3 deletions
6
omg.py
6
omg.py
|
@ -160,7 +160,7 @@ class OMG:
|
||||||
url = url.split()[0]
|
url = url.split()[0]
|
||||||
|
|
||||||
link = url.split("/")[-1].strip()
|
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"):
|
if not relpath.endswith(".md"):
|
||||||
relpath += ".md"
|
relpath += ".md"
|
||||||
|
@ -184,9 +184,9 @@ class OMG:
|
||||||
|
|
||||||
link = tokens[0].split("/")[-1].strip().replace("\\", "")
|
link = tokens[0].split("/")[-1].strip().replace("\\", "")
|
||||||
relpath = os.path.relpath(
|
relpath = os.path.relpath(
|
||||||
os.path.join(path, "../" + tokens[0]),
|
os.path.join(path, "../" + tokens[0].strip().replace("\\", "")),
|
||||||
self.path
|
self.path
|
||||||
).strip().replace("\\", "")
|
)
|
||||||
|
|
||||||
if not relpath.endswith(".md"):
|
if not relpath.endswith(".md"):
|
||||||
relpath += ".md"
|
relpath += ".md"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue