tags around the following texts
+ # "BugID: 1234"
+ # "VCS: dir/file.x"
+ # "Wiki: article"
+
+ def __processbody_bug_link(self, m):
+ ref = m.group(1)
+ bug = m.group(2)
+ text = ref + " " + mm_cfg.BUG_URL % (bug, bug)
+ return text
+
+ def __processbody_vcs_link(self, m):
+ ref = m.group(1)
+ vcs = m.group(2)
+ text = ref + " " + mm_cfg.VCS_URL % (vcs, vcs)
+ return text
+
+ def __processbody_wiki_link(self, m):
+ ref = m.group(1)
+ wiki = m.group(2)
+ text = ref + " " + mm_cfg.WIKI_URL % (wiki, wiki)
+ return text
+
# Perform Hypermail-style processing of directives
# in message bodies. Lines between and will be written
# out precisely as they are; other lines will be passed to func2
@@ -1246,6 +1274,11 @@
s = lines[i]
if s[0:1] in ' \t\n':
lines[i] = '' + s
+ # Linkify magic identifiers
+ for i in range(0, len(lines)):
+ lines[i] = re.sub(bugpat, self.__processbody_bug_link, lines[i])
+ lines[i] = re.sub(vcspat, self.__processbody_vcs_link, lines[i])
+ lines[i] = re.sub(wikipat, self.__processbody_wiki_link, lines[i])
article.html_body = lines
return article