--- tamtam/tamtam2socialtext.pl 2007/12/12 14:04:11 11 +++ tamtam/tamtam2socialtext.pl 2007/12/12 17:14:58 13 @@ -40,13 +40,19 @@ $ref->{widgets}->{widget}->{Body}->{data} || die "no data in $path ",dump( $ref ); + $data .= qq{ +---- + +Original: http://www.razmjenavjestina.org/$path +}; + $page->{ $name } = [ $data, $date ]; # strip path from page name $name =~ s,^.+/([^/]+)$,$1,; push @page_names, $name; - #warn dump( $ref ); +# warn dump( $ref ); }, }, shift @ARGV || '.'); @@ -79,6 +85,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 +106,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;