From d6cb485dd364ea39c19a386ddc017abc89e561fb Mon Sep 17 00:00:00 2001 From: Alex Schroeder Date: Mon, 10 Sep 2007 19:32:30 +0000 Subject: [PATCH] Yet another shot at fixing the whole QuoteHtml issue --- modules/markdown.pl | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/modules/markdown.pl b/modules/markdown.pl index 10acfb47..36d4226b 100644 --- a/modules/markdown.pl +++ b/modules/markdown.pl @@ -31,7 +31,7 @@ # TODO: auto links in codespans should not be interpreted (e.g. ``) -$ModulesDescription .= '

$Id: markdown.pl,v 1.41 2007/09/09 21:26:57 fletcherpenney Exp $

'; +$ModulesDescription .= '

$Id: markdown.pl,v 1.42 2007/09/10 19:32:30 fletcherpenney Exp $

'; use vars qw!%MarkdownRuleOrder @MyMarkdownRules $MarkdownEnabled $SmartyPantsEnabled!; @@ -149,9 +149,11 @@ sub MarkdownGetCluster { sub MarkdownQuoteHtml { my $html = shift; - $html = oldQuoteHtml($html); - -# $html =~ /<http\; + $html =~ s/&/&/g; + $html =~ s//>/g; + $html =~ s/[\x00-\x08\x0b\x0c\x0e-\x1f]/ /g; # legal xml: #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] + return $html; } @@ -405,7 +407,7 @@ sub AntiSpam { sub NewDoAutoLinks { my $text = shift; - $text =~ s{<((https?|ftp|dict):[^'">\s]+)>}{$1}gi; + $text =~ s{<((https?|ftp|dict):[^'">\s(>)]+)>}{$1}gi; # Email addresses: $text =~ s{ @@ -416,7 +418,7 @@ sub NewDoAutoLinks { \@ [-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+ ) - > + > }{ Markdown::_EncodeEmailAddress( Markdown::_UnescapeSpecialChars($1) ); }egix;