/[socialtext-import]/tamtam/tamtam2socialtext.pl
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 /tamtam/tamtam2socialtext.pl

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

revision 11 by dpavlin, Wed Dec 12 14:04:11 2007 UTC revision 12 by dpavlin, Wed Dec 12 14:10:37 2007 UTC
# Line 79  sub surround { Line 79  sub surround {
79          return $with . $what . $with;          return $with . $what . $with;
80  }  }
81    
82    sub pre {
83            my $text = shift;
84            $text =~ s/^{{{//;
85            $text =~ s/}}}$//;
86            return '.pre' . $text . '.pre';
87    }
88    
89  my $count = 0;  my $count = 0;
90    
91  foreach my $name ( keys %$page ) {  foreach my $name ( keys %$page ) {
# Line 93  foreach my $name ( keys %$page ) { Line 100  foreach my $name ( keys %$page ) {
100          $body =~ s/''''(.+?)''''/surround('`',$1)/gse;          $body =~ s/''''(.+?)''''/surround('`',$1)/gse;
101          $body =~ s/'''(.+?)'''/surround('*',$1)/gse;          $body =~ s/'''(.+?)'''/surround('*',$1)/gse;
102          $body =~ s/''(.+?)''/surround('_',$1)/gse;          $body =~ s/''(.+?)''/surround('_',$1)/gse;
103            $body =~ s/$RE{balanced}{-begin => "{{{"}{-end => "}}}"}{-keep}/pre($1)/gse;
104    
105          # fix bullets          # fix bullets
106          $body =~ s/^\s+([\*])/$1/gm;          $body =~ s/^\s+([\*])/$1/gm;

Legend:
Removed from v.11  
changed lines
  Added in v.12

  ViewVC Help
Powered by ViewVC 1.1.26