summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2021-06-03 01:25:00 +0000
committerRob Austein <sra@hactrn.net>2021-06-03 01:33:31 +0000
commit838f9cf8b78dc561c508e0ed37b1373811fece20 (patch)
treebc8fe78443d74966cabe164d09d51f31a14a1300
parentd0c10e7a18909984011a279b8d6ca95a20d57b6a (diff)
Use absolute form of attachment links
-rwxr-xr-xtrac2md.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/trac2md.py b/trac2md.py
index e9b5f68..4528b81 100755
--- a/trac2md.py
+++ b/trac2md.py
@@ -54,7 +54,7 @@ class Trac2Markdown:
if text == link and link.startswith("http") and "://" in link:
return "<{}>".format(link)
elif scheme == "attachment:":
- return "[{}]({{attach}}{}/{})".format(text, self.slug, link)
+ return "[{}]({{attach}}/{}/{})".format(text, self.slug, link)
elif scheme in ("source:", "browser:"):
return "[{}]({}/{})".format(text, self.source_url.rstrip("/"), link.lstrip("/"))
elif scheme == "wiki:" or (scheme is None and self.camelcase_pattern.match(link)):
@@ -67,7 +67,7 @@ class Trac2Markdown:
if "://" in text:
return "<img src=\"{}\">".format(text)
else:
- return "![{}]({{attach}}{}/{})".format(text, self.slug, quote(text, ""))
+ return "![{}]({{attach}}/{}/{})".format(text, self.slug, quote(text, ""))
def __init__(self, source_url):
self.source_url = source_url