1 Feb 2011 13:34
Enabeling E-Mail Name
Berengar <Berengar.Lehr <at> gmx.de>
2011-02-01 12:34:49 GMT
2011-02-01 12:34:49 GMT
Dear readers,
of the Markdown-(Extra)-Discussion list. After including Markdown as the Markup language of choice for
my
configuration files I stumbled over a feature I was missing: Adding e-mail links with names. I came up with a
little hack I want to share with you.
Old Syntax: (mailto:$mailadress <at> $mailhost)
New Syntax: (mailto:$mailadress <at> $mailhost[ My Name)
changes:
1) function doAutoLinks: insert '(?:\W*(.*))' in RegEx before the '>' line
2) function _doAutoLinks_email_callback: insert '$text = $matches[3];' before line starting with
$link = ...
3) function encodeEmailAdress:
a) change signature to ($addr, $text)
b) wrap the line starting with $text = ... so it reads 'if ($text == "") { $text = ... }'
pretty easy, istn't it?
Greetings,
Berengar
RSS Feed