diff options
author | Rob Austein <sra@hactrn.net> | 2021-02-15 23:28:19 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2021-02-15 23:28:19 +0000 |
commit | a255b67f6d487703db648c58ee1e50c0aa85c2a6 (patch) | |
tree | 34d85d7423606178370a057e0fd291b2ebdb248b /trac2md.py | |
parent | 7acac1b6d1d8fbbe4b3c407be891f8bf65120c93 (diff) |
Get inter-page links right
Diffstat (limited to 'trac2md.py')
-rwxr-xr-x | trac2md.py | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -57,7 +57,7 @@ def convert_traclink_to_creolelink(line): text = m.group(1).strip() if " " in text: line = line.replace(m.group(0), "[[{0[0]}|{0[1]}]]".format(text.split(" ", 1))) - elif any(text.startswith(scheme) for scheme in ("http:", "https:", "wiki:", "attachment:")) or camelcase_pattern.match(text): + elif ":" in text or camelcase_pattern.match(text): line = line.replace(m.group(0), "[[{}]]".format(text)) return line @@ -76,7 +76,7 @@ def convert_wikilinks(line, slug): elif scheme == "attachment:": mdlink = "[{}]({{attach}}{}/{})".format(text, slug, link) elif scheme == "wiki:" or (scheme is None and camelcase_pattern.match(link)): - mdlink = "[{}]({}.md)".format(text, link) + mdlink = "[{}]({{filename}}{}.md)".format(text, link) else: mdlink = "[{}]({})".format(text, link) line = line.replace(m.group(0), mdlink) |