|
@@ -54,7 +54,7 @@ class Trac2Markdown:
|
|
if text == link and link.startswith("http") and "://" in link:
|
|
if text == link and link.startswith("http") and "://" in link:
|
|
return "<{}>".format(link)
|
|
return "<{}>".format(link)
|
|
elif scheme == "attachment:":
|
|
elif scheme == "attachment:":
|
|
- return "[{}]({{attach}}{}/{})".format(text, self.slug, link)
|
|
|
|
|
|
+ return "[{}]({{attach}}/{}/{})".format(text, self.slug, link)
|
|
elif scheme in ("source:", "browser:"):
|
|
elif scheme in ("source:", "browser:"):
|
|
return "[{}]({}/{})".format(text, self.source_url.rstrip("/"), link.lstrip("/"))
|
|
return "[{}]({}/{})".format(text, self.source_url.rstrip("/"), link.lstrip("/"))
|
|
elif scheme == "wiki:" or (scheme is None and self.camelcase_pattern.match(link)):
|
|
elif scheme == "wiki:" or (scheme is None and self.camelcase_pattern.match(link)):
|
|
@@ -67,7 +67,7 @@ class Trac2Markdown:
|
|
if "://" in text:
|
|
if "://" in text:
|
|
return "<img src=\"{}\">".format(text)
|
|
return "<img src=\"{}\">".format(text)
|
|
else:
|
|
else:
|
|
- return "![{}]({{attach}}{}/{})".format(text, self.slug, quote(text, ""))
|
|
|
|
|
|
+ return "![{}]({{attach}}/{}/{})".format(text, self.slug, quote(text, ""))
|
|
|
|
|
|
def __init__(self, source_url):
|
|
def __init__(self, source_url):
|
|
self.source_url = source_url
|
|
self.source_url = source_url
|
|
@@ -158,12 +158,12 @@ class Trac2Markdown:
|
|
#
|
|
#
|
|
nested_line = line.lstrip(' ')
|
|
nested_line = line.lstrip(' ')
|
|
if nested_line.startswith('- ') or nested_line.startswith('* '):
|
|
if nested_line.startswith('- ') or nested_line.startswith('* '):
|
|
|
|
+ indent = len(line) - len(nested_line)
|
|
if not in_list:
|
|
if not in_list:
|
|
new_content.append("\n")
|
|
new_content.append("\n")
|
|
nested_level = 0
|
|
nested_level = 0
|
|
- prev_indent = 0
|
|
|
|
|
|
+ prev_indent = indent
|
|
in_list = True
|
|
in_list = True
|
|
- indent = len(line) - len(nested_line)
|
|
|
|
text_indent = len(line) - len(nested_line[1:].lstrip())
|
|
text_indent = len(line) - len(nested_line[1:].lstrip())
|
|
if indent > prev_indent:
|
|
if indent > prev_indent:
|
|
nested_level += 1
|
|
nested_level += 1
|