--- tamtam/tamtam2socialtext.pl 2007/12/12 14:04:11 11 +++ tamtam/tamtam2socialtext.pl 2007/12/12 14:10:37 12 @@ -79,6 +79,13 @@ return $with . $what . $with; } +sub pre { + my $text = shift; + $text =~ s/^{{{//; + $text =~ s/}}}$//; + return '.pre' . $text . '.pre'; +} + my $count = 0; foreach my $name ( keys %$page ) { @@ -93,6 +100,7 @@ $body =~ s/''''(.+?)''''/surround('`',$1)/gse; $body =~ s/'''(.+?)'''/surround('*',$1)/gse; $body =~ s/''(.+?)''/surround('_',$1)/gse; + $body =~ s/$RE{balanced}{-begin => "{{{"}{-end => "}}}"}{-keep}/pre($1)/gse; # fix bullets $body =~ s/^\s+([\*])/$1/gm;