#!/usr/bin/perl -w # # fhtchars --crb3 24apr01 # inline filter to fix Micro$soft crap # # in jstar, # - ^Ks to save prior work on the file, just in case # - mark the block to filter with ^Kb, ^Kk # - ^Qb to put the cursor at the beginning of the block # - ^K/ ...name this filter in the dialog that pops up # - inspect the result before saving # while(defined($inline=)){ chomp($inline); $inline =~ s/\r//; # dos -> unix eol # # multiline span tag? pack it together. # while($inline =~ /\{1}?/){ $inline .= $newline = ; chomp $inline; $inline =~ s/\r//; last unless defined($newline); } $inline =~ s/\{1}?//gi; # kill all span tags $inline =~ s/\<\/span\>//gi; # kill all /span tags $inline =~ s/\/

/gi; # chop out classes in

$inline =~ s/\{1}?//gi; # chop out divs $inline =~ s/\<\/div\>//gi; # chop out divs $inline =~ s/\<\/?font\s?[^>]*\>{1}?//gi; # kill all font tags $inline =~ s/\//gi; $inline =~ s/\<\/o\:p\>/<\/p>/gi; # ->

$inline =~ tr/\x91\x92\x93\x94/''""/; # fix the damn quotes $inline =~ s/\x85/.../g; $inline =~ s/\x96/--/g; $inline =~ s/\xBD/1\/2/g; print STDOUT "$inline\n"; # still got its \n } __END__ ^R+80h = 0x92 -> apostrophe ^S+80h = 0x93 -> start quote ^T+80h = 0x94 -> end quote ^V+80h = 0x96 -> em-dash (doubledash) 0xBD -> 1/2 kill all span tags. kill all class= declarations within

tags. kill all font tags kill crap... convert to

. locase all tags. (they are, but...) kill all ^M.