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 ) { |
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; |