Igor Gariev (gariev) wrote in changelog,
Igor Gariev
gariev
changelog

[livejournal] r17106: Style formatting only: tabs converted to...

Committer: gariev
Style formatting only: tabs converted to spaces
U   trunk/cgi-bin/LJ/SpellCheck.pm
Modified: trunk/cgi-bin/LJ/SpellCheck.pm
===================================================================
--- trunk/cgi-bin/LJ/SpellCheck.pm	2010-08-10 08:59:07 UTC (rev 17105)
+++ trunk/cgi-bin/LJ/SpellCheck.pm	2010-08-11 02:12:11 UTC (rev 17106)
@@ -70,40 +70,40 @@
     $lineidx = 1;
     $mscnt = 0;
     foreach my $inline (split(/\n/, $$journal)) {
-	$srcidx = 0;
-	chomp($inline);
-	print $iwrite "^$inline\n";
-	
-	my $idata;
-	do {
-	    $idata = <$iread>;
-	    chomp($idata);
-	    
-	    if ($idata =~ /^& /) {
-		$idata =~ s/^& (\S+) (\d+) (\d+): //;
-		$mscnt++;
-		my ($word, $sugcount, $ofs) = ($1, $2, $3);
-		$ofs -= 1; # because ispell reports "1" for first character
-		
-		$output .= LJ::ehtml(substr($inline, $srcidx, $ofs-$srcidx));
-		$output .= "<font color=\"$self->{'color'}\">".LJ::ehtml($word)."</font>";
-		
-		$footnotes .= "<tr valign=top><td align=right><font color=$self->{'color'}>".LJ::ehtml($word).
+        $srcidx = 0;
+        chomp($inline);
+        print $iwrite "^$inline\n";
+        
+        my $idata;
+        do {
+            $idata = <$iread>;
+            chomp($idata);
+            
+            if ($idata =~ /^& /) {
+                $idata =~ s/^& (\S+) (\d+) (\d+): //;
+                $mscnt++;
+                my ($word, $sugcount, $ofs) = ($1, $2, $3);
+                $ofs -= 1; # because ispell reports "1" for first character
+                
+                $output .= LJ::ehtml(substr($inline, $srcidx, $ofs-$srcidx));
+                $output .= "<font color=\"$self->{'color'}\">".LJ::ehtml($word)."</font>";
+                
+                $footnotes .= "<tr valign=top><td align=right><font color=$self->{'color'}>".LJ::ehtml($word).
                               "</font></td><td>".LJ::ehtml($idata)."</td></tr>";
-		
-		$srcidx = $ofs + length($word);
-	    } elsif ($idata =~ /^\# /) {
-		$other_bad = 1;
-		$idata =~ /^\# (\S+) (\d+)/;
-		my ($word, $ofs) = ($1, $2);
-		$ofs -= 1; # because ispell reports "1" for first character
-		$output .= LJ::ehtml(substr($inline, $srcidx, $ofs-$srcidx));
-		$output .= "<font color=\"$self->{'color'}\">".LJ::ehtml($word)."</font>";
-		$srcidx = $ofs + length($word);
-	    }
-	} while ($idata ne "");
-	$output .= LJ::ehtml(substr($inline, $srcidx, length($inline)-$srcidx)) . "<br>\n";
-	$lineidx++;
+                
+                $srcidx = $ofs + length($word);
+            } elsif ($idata =~ /^\# /) {
+                $other_bad = 1;
+                $idata =~ /^\# (\S+) (\d+)/;
+                my ($word, $ofs) = ($1, $2);
+                $ofs -= 1; # because ispell reports "1" for first character
+                $output .= LJ::ehtml(substr($inline, $srcidx, $ofs-$srcidx));
+                $output .= "<font color=\"$self->{'color'}\">".LJ::ehtml($word)."</font>";
+                $srcidx = $ofs + length($word);
+            }
+        } while ($idata ne "");
+        $output .= LJ::ehtml(substr($inline, $srcidx, length($inline)-$srcidx)) . "<br>\n";
+        $lineidx++;
     }
 
     $iread->close;
@@ -128,8 +128,8 @@
 
   use LJ::SpellCheck;
   my $s = new LJ::SpellCheck { 'spellcommand' => 'ispell -a -h',
-			       'color' => '#ff0000',
-			   };
+                               'color' => '#ff0000',
+                           };
 
   my $text = "Lets mispell thigns!";
   my $correction = $s->check_html(\$text);

Tags: gariev, livejournal, pm
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments