diff --git a/Markdown.pl b/Markdown.pl index a6391fb..cfc6c17 100755 --- a/Markdown.pl +++ b/Markdown.pl @@ -1364,7 +1364,7 @@ sub _MakeAnchorId { sub _GetNewAnchorId { my $link = _strip(lc(shift)); - return '' if defined($g_anchors{$link}); + return '' if $link eq "" || defined($g_anchors{$link}); my $id = _MakeAnchorId($link); return '' unless $id; $g_anchors{$link} = '#'.$id; @@ -1444,15 +1444,16 @@ sub _DoHeaders { $text =~ s{ ^(\#{1,6}) # $1 = string of #'s [ ]* - (.+?) # $2 = Header text + ((?:(?:(?" . _RunSpanGamut($h) . "\n\n"; }egmx;