--- Markdown/macro.py.orig 2013-03-20 21:49:04.000000000 +0000 +++ Markdown/macro.py 2013-03-20 22:34:56.000000000 +0000 @@ -45,12 +45,17 @@ pre, target, suf = filter(None, m.groups()) out = StringIO() f.format(target, out) - url = re.search(HREF, out.getvalue()).groups()[0] + out_value = out.getvalue() + if target.startswith('mailto:') and out_value.startswith('
'): + # strip
...
+ url = out_value[3:-5].strip() + else: + url = re.search(HREF, out_value).groups()[0] # Trac creates relative links, which Markdown won't touch inside #