/[webpac]/trunk/back2html.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/back2html.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 66 by dpavlin, Fri Jul 4 23:28:17 2003 UTC revision 80 by dpavlin, Tue Jul 8 08:24:13 2003 UTC
# Line 7  Line 7 
7  sub back2html {  sub back2html {
8          my $html = shift;          my $html = shift;
9    
10            $html =~ s/</&lt;/g;
11            $html =~ s/>/&gt;/g;
12          my $out;          my $out;
13          foreach $line (split(/###/,$html)) {          foreach $line (split(/\s*###\s*/,$html)) {
14                  $out .= "<tr><td>";                  $out .= "<tr><td valign=\"top\">";
15                  my @items = split(/#-#/,$line);                  my @items = split(/\s*#-#\s*/,$line);
16                    # convert spaces in left field to non-breaking spaces
17                    $items[0] =~ s#\s+#&nbsp;#g;
18                    # try to make link on right field
19                  if ($items[1] =~ m#(http://[\S]+)\s*.*?#i) {                  if ($items[1] =~ m#(http://[\S]+)\s*.*?#i) {
                         my $url = $1;  
20                          # chop URLS longer than 60 characters                          # chop URLS longer than 60 characters
21                          my $url = substr($1,0,60);                          my $url = substr($1,0,60);
22                          $url .= "..." if (length($1) > 60);                          $url .= "..." if (length($1) > 60);

Legend:
Removed from v.66  
changed lines
  Added in v.80

  ViewVC Help
Powered by ViewVC 1.1.26