Kaynağa Gözat

Use absolute form of attachment links

Rob Austein 3 yıl önce
ebeveyn
işleme
838f9cf8b7
1 değiştirilmiş dosya ile 2 ekleme ve 2 silme
  1. 2 2
      trac2md.py

+ 2 - 2
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