Menu

#2 Page names only are highlited once per page.

closed
nobody
None
5
2007-06-21
2004-02-29
Anonymous
No

The page names that are on pages are only highlited
once per page.

sub words {
$page = $_[0];
foreach my $st (split
/\s|\r?\n|\'|\|\"|\?|\.|\:|,|\*/, $page) {
next if $st !~ /^[A-Z]/ || ! -f "$filedir/$st";
$page =~ s/([^\w"<])$st([^\w"])/<a
href="?$st">$st<\/a>/g
if (filetype ($st) =~ /text/); # <-- was missing
the global flag g and only replaced 1st occurence.
$page =~ s/([^\w"<])$st([^\w"])/<img src="$st"
alt="$st">/g
if (filetype ($st) =~ /png|jpeg/);
}
return $page;
}

--rick
polarzinc@yahoo.com

Discussion

  • Robert Kiesling

    Robert Kiesling - 2007-06-21

    Logged In: YES
    user_id=583453
    Originator: NO

    Fixed. Also fixes in w_eval for pages that contain Perl templates.

     
  • Robert Kiesling

    Robert Kiesling - 2007-06-21
    • status: open --> closed
     

Log in to post a comment.

Auth0 Logo