summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
2901b73)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
def _render_wiki_link(self, m):
path, alias = m.groups()
def _render_wiki_link(self, m):
path, alias = m.groups()
- # Allow relative links
- if not path.startswith("/"):
+ # Nothing to do for absolute links
+ if path.startswith("/"):
+ pass
+
+ # Relative links (one-level down)
+ elif path.startswith("./"):
path = os.path.join(self.path, path)
path = os.path.join(self.path, path)
+ # All other relative links
+ else:
+ p = os.path.dirname(self.path)
+ path = os.path.join(p, path)
+
# Normalise links
path = os.path.normpath(path)
# Normalise links
path = os.path.normpath(path)