… | |
… | |
35 | s/^\s+//; |
35 | s/^\s+//; |
36 | s/\s+$//; |
36 | s/\s+$//; |
37 | s/\s+/ /g; |
37 | s/\s+/ /g; |
38 | |
38 | |
39 | $_ |
39 | $_ |
|
|
40 | } |
|
|
41 | |
|
|
42 | sub special { |
|
|
43 | $MA_BEG . (join $MA_SEP, @_) . $MA_END |
40 | } |
44 | } |
41 | |
45 | |
42 | package AsParagraphs; |
46 | package AsParagraphs; |
43 | |
47 | |
44 | use strict; |
48 | use strict; |
… | |
… | |
68 | "<u>" . (::asxml $link) . "</u>" |
72 | "<u>" . (::asxml $link) . "</u>" |
69 | } elsif ($link =~ /^\$ARCH\/(.+)$/) { |
73 | } elsif ($link =~ /^\$ARCH\/(.+)$/) { |
70 | my $path = $1; |
74 | my $path = $1; |
71 | (my $base = $path) =~ s/.*\///; |
75 | (my $base = $path) =~ s/.*\///; |
72 | -f "$ARCH/$path" && system "rsync -av -c \Q$ARCH/$path\E \Qresources/arch/$base"; |
76 | -f "$ARCH/$path" && system "rsync -av -c \Q$ARCH/$path\E \Qresources/arch/$base"; |
73 | "${MA_BEG}image${MA_SEP}arch/$base$MA_END" |
77 | ::special image => "arch/$base", 1; |
74 | } else { |
78 | } else { |
75 | "${MA_BEG}link$MA_SEP$text$MA_SEP$link$MA_END" |
79 | ::special link => $text, $link |
76 | } |
80 | } |
77 | } |
81 | } |
78 | |
82 | |
79 | sub view_item { |
83 | sub view_item { |
80 | push @result, { |
84 | push @result, { |
… | |
… | |
156 | sub view_for { |
160 | sub view_for { |
157 | if ($_[1]->format eq "image") { |
161 | if ($_[1]->format eq "image") { |
158 | push @result, { |
162 | push @result, { |
159 | indent => $indent * 16, |
163 | indent => $indent * 16, |
160 | level => $level, |
164 | level => $level, |
161 | markup => "${MA_BEG}image${MA_SEP}pod/" . $_->text . $MA_END, |
165 | markup => (::special image => "pod/" . $_->text), |
162 | }; |
166 | }; |
163 | } |
167 | } |
164 | () |
168 | () |
165 | } |
169 | } |
166 | |
170 | |