From: i18n <i1...@ya...> - 2002-09-05 18:49:12
|
This is from admin.pl in Bebder (it may be in 2.2 for all I know also)... 1 while ($story_content =~ m|<A(.*?)>(.*?)</A>|sgi) { 2 my($url, $label) = ($1, $2); 3 $label =~ s/(\S{30})/$1 /g; 4 $related_links .= "<LI><A$url>$label</A></LI>\n" unless $label eq "[?]"; This is the part of the code where the text that goes in the "Related Links" box is generated. My question is about line 3 - it looks like the purpose is to break up a chunk of text in the label that is over 30 characters and insert spaces every 30 chars. Why? Is this to make sure that the box width isn't broke by long text? If so there is a bit of a bug.... I was trying to add a link to a book notice to a page that was a pointer to my associate link on amazon, complete with an image to the cover. The link is this: <A HREF="http://www.amazon.com/exec/obidos/ASIN/0735712085/wwwi18ncom-20"><IMG SRC="/images/0735712085.01.TZZZZZZZ.jpg" border="0" alt="cover" hspace="3" vspace="3" WIDTH="73" HEIGHT="90"><br><center>Buy From Amazon</center></A> but after I insert a errorLog call after the loop above to look at $related_links, I get this: [Thu Sep 5 17:56:46 2002] [error] /admin.pl:Apache::ROOTwww_2ei18n_2ecom::admin_2epl:/usr/local/slash/site/slash/htdocs/admin.pl:1284:updateStory: getRelated: <LI><A HREF="http://www.amazon.com/exec/obidos/ASIN/0735712085/wwwi18ncom-20"><IMG SRC="/images/0735712085.01.TZZ ZZZZZ.jpg" border="0" alt="cover" hspace="3" vspace="3" WIDTH="73" HEIGHT="90"><br><center>Buy From Amazon</center></A></LI> Note the extra space in the middle of the run of "Z"s, which is 30 spaces from the begining of the SRC element. Does anybody have an improved Regex for the questionable line 3, or is it even necessary at all? Can I just comment it out? Thanks! Barry |