[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#181872: Patch



tags 181872 + patch
thanks

[Problem of '<URL: http://scummvm.sf.net/compatibility.php>'
being converted to 
'<URL: <a href="http://scummvm.sf.net/compatibility.php>">http://scummvm.sf.net/compatibility.php></a>']

The following patch should fix the problem. It allows whitespaces
beetween "<URL:" and "http://";. I've also added some more handling of
html special chars.

I can commit it myself. Just say if I should.

hth,
	Frank Lichtenheld

Index: pages.pl
===================================================================
RCS file: /cvs/webwml/packages/htmlscripts/pages.pl,v
retrieving revision 1.9
diff -u -r1.9 pages.pl
--- pages.pl    30 Jan 2003 14:43:59 -0000      1.9
+++ pages.pl    13 Mar 2003 14:30:56 -0000
@@ -161,7 +161,10 @@
                }
                $short_desc = $package{$pack}{'short-desc'};
                $long_desc = $package{$pack}{'long-desc'};
-               $long_desc =~ s,<((URL:)?http://[\S~-]+?/?)>,\&lt\;$1\&gt\;,go;
+               $long_desc =~ s/\&/\&amp\;/go;
+               $long_desc =~ s,<((URL:)?\s*http://[\S~-]+?/?)>,\&lt\;$1\&gt\;,go;
+               $long_desc =~ s/</\&lt\;/go;
+               $long_desc =~ s/>/\&gt\;/go;
                $long_desc =~ s,(http://[\S~-]+?/?)((\&gt\;)?[)]?[']?[.\,]?(\s|$)),<a href=\"$1\">$1</a>$2,go;
                $long_desc =~ s/\A //o;
                $long_desc =~ s/\n /\n/sgo;


-- 
*** Frank Lichtenheld <frank@lichtenheld.de> ***
          *** http://www.djpig.de/ ***
see also: - http://www.usta.de/
          - http://fachschaft.physik.uni-karlsruhe.de/



Reply to: