40 |
$ref->{widgets}->{widget}->{Body}->{data} || |
$ref->{widgets}->{widget}->{Body}->{data} || |
41 |
die "no data in $path ",dump( $ref ); |
die "no data in $path ",dump( $ref ); |
42 |
|
|
43 |
|
$data .= qq{ |
44 |
|
---- |
45 |
|
|
46 |
|
Original: http://www.razmjenavjestina.org/$path |
47 |
|
}; |
48 |
|
|
49 |
$page->{ $name } = [ $data, $date ]; |
$page->{ $name } = [ $data, $date ]; |
50 |
|
|
51 |
# strip path from page name |
# strip path from page name |
52 |
$name =~ s,^.+/([^/]+)$,$1,; |
$name =~ s,^.+/([^/]+)$,$1,; |
53 |
push @page_names, $name; |
push @page_names, $name; |
54 |
|
|
55 |
#warn dump( $ref ); |
# warn dump( $ref ); |
56 |
}, |
}, |
57 |
}, shift @ARGV || '.'); |
}, shift @ARGV || '.'); |
58 |
|
|
85 |
return $with . $what . $with; |
return $with . $what . $with; |
86 |
} |
} |
87 |
|
|
88 |
|
sub pre { |
89 |
|
my $text = shift; |
90 |
|
$text =~ s/^{{{//; |
91 |
|
$text =~ s/}}}$//; |
92 |
|
return '.pre' . $text . '.pre'; |
93 |
|
} |
94 |
|
|
95 |
my $count = 0; |
my $count = 0; |
96 |
|
|
97 |
foreach my $name ( keys %$page ) { |
foreach my $name ( keys %$page ) { |
106 |
$body =~ s/''''(.+?)''''/surround('`',$1)/gse; |
$body =~ s/''''(.+?)''''/surround('`',$1)/gse; |
107 |
$body =~ s/'''(.+?)'''/surround('*',$1)/gse; |
$body =~ s/'''(.+?)'''/surround('*',$1)/gse; |
108 |
$body =~ s/''(.+?)''/surround('_',$1)/gse; |
$body =~ s/''(.+?)''/surround('_',$1)/gse; |
109 |
|
$body =~ s/$RE{balanced}{-begin => "{{{"}{-end => "}}}"}{-keep}/pre($1)/gse; |
110 |
|
|
111 |
# fix bullets |
# fix bullets |
112 |
$body =~ s/^\s+([\*])/$1/gm; |
$body =~ s/^\s+([\*])/$1/gm; |