From 088ecec94d2e7d8222704e5cf1a0e43e566777a0 Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Fri, 8 Dec 2006 22:51:18 -0800 Subject: [PATCH] Use <> syntax for mailto URLs with the email as link text. --- WikiConverter/Markdown.pm | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/WikiConverter/Markdown.pm b/WikiConverter/Markdown.pm index 6c7497c..1135990 100644 --- a/WikiConverter/Markdown.pm +++ b/WikiConverter/Markdown.pm @@ -171,8 +171,8 @@ sub _link { my $style = $self->link_style; $style = 'inline' if $url =~ /^\#/ and $self->force_inline_anchor_links; - if( $url eq $text ) { - return sprintf "<%s>", $url; + if( $url =~ /^(?:mailto:)?\Q$text\E$/ ) { + return sprintf "<%s>", $text; } elsif( $style eq 'inline' ) { return sprintf "[%s](%s %s)", $text, $url, $title if $title; return sprintf "[%s](%s)", $text, $url; -- 1.4.4.2