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.12 by root, Sat Aug 18 17:33:53 2007 UTC vs.
Revision 1.13 by root, Sun Aug 31 09:03:31 2008 UTC

13use base "Pod::POM::View"; 13use base "Pod::POM::View";
14 14
15sub asxml($) { 15sub asxml($) {
16 local $_ = $_[0]; 16 local $_ = $_[0];
17 17
18 s/&/&/g;
19 s/>/>/g;
20 s/</&lt;/g; 18 s/</E<lt>/g;
19 s/>/E<gt>/g;
21 20
22 $_ 21 $_
23} 22}
24 23
25sub flatten($) { 24sub flatten($) {
33 $_ 32 $_
34} 33}
35 34
36*view_seq_file = 35*view_seq_file =
37*view_seq_code = 36*view_seq_code =
38*view_seq_bold = sub { "<b>$_[1]</b>" }; 37*view_seq_bold = sub { "B<$_[1]>" };
39*view_seq_italic = sub { "<i>$_[1]</i>" }; 38*view_seq_italic = sub { "I<$_[1]>" };
40*view_seq_zero = sub { }; 39*view_seq_zero = sub { };
41*view_seq_space = sub { my $text = $_[1]; $text =~ s/ /\xa0/g; $text }; 40*view_seq_space = sub { my $text = $_[1]; $text =~ s/ /\xa0/g; $text };
42*view_seq_index = sub { push @{ $result[-1]{index} }, $_[1]; "" }; 41*view_seq_index = sub { push @{ $result[-1]{index} }, $_[1]; "" };
43 42
44sub view_seq_text { 43sub view_seq_text {
51 my (undef, $link) = @_; 50 my (undef, $link) = @_;
52 51
53 my $text = $link =~ s/^(.*)\|// ? $1 : $link; 52 my $text = $link =~ s/^(.*)\|// ? $1 : $link;
54 53
55 if ($link =~ /http:/) { 54 if ($link =~ /http:/) {
56 "<u>" . (asxml $link) . "</u>" 55 "U<" . (asxml $link) . ">"
57 } else { 56 } else {
58 () 57 ()
59 } 58 }
60} 59}
61 60
76sub view_verbatim { 75sub view_verbatim {
77 push @result, { 76 push @result, {
78 type => "verbatim", 77 type => "verbatim",
79 indent => $indent * 16, 78 indent => $indent * 16,
80 level => $level, 79 level => $level,
81 markup => asxml $_[1], 80 markup => $_[1],
82 }; 81 };
83 () 82 ()
84} 83}
85 84
86sub view_textblock { 85sub view_textblock {
183 182
184sub load_pod($) { 183sub load_pod($) {
185 my ($path) = @_; 184 my ($path) = @_;
186 185
187 Coro::Storable::thaw cf::cache "cf::pod::as_paragraphs/$path" => [$path], 186 Coro::Storable::thaw cf::cache "cf::pod::as_paragraphs/$path" => [$path],
188 2 => sub { 187 3 => sub {
189 my ($src) = @_; 188 my ($src) = @_;
190 189
191 cf::fork_call { 190 cf::fork_call {
192 my $pod = $src->[0]; 191 my $pod = $src->[0];
193 utf8::decode $pod; 192 utf8::decode $pod;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines