ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/lib/cf/pod.pm
(Generate patch)

Comparing deliantra/server/lib/cf/pod.pm (file contents):
Revision 1.13 by root, Sun Aug 31 09:03:31 2008 UTC vs.
Revision 1.14 by root, Sat Sep 6 20:06:10 2008 UTC

10 10
11use strict; 11use strict;
12 12
13use base "Pod::POM::View"; 13use base "Pod::POM::View";
14 14
15sub asxml($) { 15sub aspod($) {
16 local $_ = $_[0]; 16 local $_ = $_[0];
17 17
18 s/</E<lt>/g; 18 s/</E<lt>/g;
19 s/>/E<gt>/g; 19 s/>/E<gt>/g;
20 20
22} 22}
23 23
24sub flatten($) { 24sub flatten($) {
25 local $_ = $_[0]; 25 local $_ = $_[0];
26 26
27 s/<[^>]+>//g;
28 s/^\s+//; 27 s/^\s+//;
29 s/\s+$//; 28 s/\s+$//;
30 s/\s+/ /g; 29 s/\s+/ /g;
31 30
32 $_ 31 $_
33} 32}
34 33
35*view_seq_file = 34*view_seq_file = sub { "B<$_[1]>" };
36*view_seq_code = 35*view_seq_code = sub { "B<$_[1]>" };
37*view_seq_bold = sub { "B<$_[1]>" }; 36*view_seq_bold = sub { "B<$_[1]>" };
38*view_seq_italic = sub { "I<$_[1]>" }; 37*view_seq_italic = sub { "I<$_[1]>" };
39*view_seq_zero = sub { }; 38*view_seq_zero = sub { "Z<>" };
40*view_seq_space = sub { my $text = $_[1]; $text =~ s/ /\xa0/g; $text }; 39*view_seq_space = sub { my $text = $_[1]; $text =~ s/ /\xa0/g; $text };
41*view_seq_index = sub { push @{ $result[-1]{index} }, $_[1]; "" }; 40*view_seq_index = sub { push @{ $result[-1]{index} }, $_[1]; "" };
42 41
43sub view_seq_text { 42sub view_seq_text {
44 my $text = $_[1]; 43 my $text = $_[1];
45 $text =~ s/\s+/ /g; 44 $text =~ s/\s+/ /g;
46 asxml $text 45 aspod $text
47} 46}
48 47
49sub view_seq_link { 48sub view_seq_link {
50 my (undef, $link) = @_; 49 my (undef, $link) = @_;
51 50
182 181
183sub load_pod($) { 182sub load_pod($) {
184 my ($path) = @_; 183 my ($path) = @_;
185 184
186 Coro::Storable::thaw cf::cache "cf::pod::as_paragraphs/$path" => [$path], 185 Coro::Storable::thaw cf::cache "cf::pod::as_paragraphs/$path" => [$path],
187 3 => sub { 186 4 => sub {
188 my ($src) = @_; 187 my ($src) = @_;
189 188
190 cf::fork_call { 189 cf::fork_call {
191 my $pod = $src->[0]; 190 my $pod = $src->[0];
192 utf8::decode $pod; 191 utf8::decode $pod;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines