/[pub]/suikawiki/script/misc/plugins/SuikaWiki09.pm
Suika

Contents of /suikawiki/script/misc/plugins/SuikaWiki09.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Sun May 16 23:05:49 2010 UTC (14 years, 5 months ago) by wakaba
Branch: MAIN
CVS Tags: suikawiki3-redirect, HEAD
Branch point for: helowiki-2005
added latest .pm files

1 use strict;
2 package SuikaWiki::Plugin::Registry;
3
4
5 our %Info;
6 $Info{q#SuikaWiki09#}->{Name} = q#SuikaWiki09#;
7 $Info{q#SuikaWiki09#}->{q#Version#} = q#2005.1118.1420#;
8 $Info{q#SuikaWiki09#}->{q#InterfaceVersion#} = q#2.9.1#;
9 $Info{q#SuikaWiki09#}->{q#mkpluginVersion#} = q#2.1.21#;
10 $Info{q#SuikaWiki09#}->{q#module_name#} = q#SuikaWiki::Plugin::plugin::SuikaWiki091051018142033w90Q#;
11 $Info{q#SuikaWiki09#}->{q#Date.RCS#} = q#$Date: 2005/07/04 12:27:23 $#;
12 $Info{q#SuikaWiki09#}->{RequiredPlugin} = [q#Edit#, q#WikiFormCore#, q#WikiLinking#, q#WikiStruct#];
13 $Info{q#SuikaWiki09#}->{Description} = [[q#SuikaWiki/0.9 and SuikaWiki/0.10 document formats#, q#en#, q##]];
14 $Info{q#SuikaWiki09#}->{License} = [[q#%%Perl%%#, q##, q##]];
15 $Info{q#SuikaWiki09#}->{Author} = [[[[q#Wakaba#, q#ja#, q#Latn#]], [[q#w@suika.fam.cx#]], [q##]]];
16 package SuikaWiki::Plugin::plugin::SuikaWiki091051018142033w90Q;
17
18
19 #line 1 "(WikiPlugin module source SuikaWiki09.wp2, block Plugin/Use)"
20 use Message::Markup::XML::QName qw/NS_xml_URI/;
21 my $Reg_Form_Content_M = qr{
22 \#form
23 (?:
24 \( (\w+) \) ## id
25 )?
26 : ' ((?>[^\\']*)(?>(?>[^\\']+|\\.)*)) ' ## input
27 (?> : ' ((?>[^\\']*)(?>(?>[^\\']+|\\.)*)) ' ## template
28 (?> : ' ((?>[^\\']*)(?>(?>[^\\']+|\\.)*)) ' )? )? ## option
29 }x;
30 my $Reg_Embed_Content_M = qr{
31 \#([a-z-]+)
32 (?>
33 \( (\w+) \) ## id
34 )?
35 (?>
36 : ( \w+ (?> : \w+ )* ) ## parameter
37 )?
38 }x;
39 my $Reg_URI_Opaque = qr{
40 (?>[^<>"]*)
41 (?>
42 (?>
43 [^<>"]+
44 | "(?>[^"\\]*)(?>(?>[^"\\]+|\\.)*)"
45 )*
46 )
47 }x;
48 my ($WIKIRESOURCE, $WIKISTRUCT, $WIKIFORMCORE, $WIKILINKING);
49 #line 1 "(WikiPlugin module SuikaWiki09, chunk 1)"
50
51 package SuikaWiki::Format::Definition::SuikaWiki::V0;
52
53 our @ISA;
54 push @ISA, q#SuikaWiki::Format::Definition::Text::Plain#;
55
56 package SuikaWiki::Format::Definition::SuikaWiki::V0_10;
57
58 our @ISA;
59 push @ISA, q#SuikaWiki::Format::Definition::SuikaWiki::V0_9#;
60 $SuikaWiki::Format::Definition::Class{q#MAGIC:SuikaWiki/0.10\#\##} = 'SuikaWiki::Format::Definition::SuikaWiki::V0_10';
61 $SuikaWiki::Format::Definition::Class{q#IMT:text/x-suikawiki;version="0.10"\#\##} = 'SuikaWiki::Format::Definition::SuikaWiki::V0_10';
62
63 package SuikaWiki::Format::Definition::SuikaWiki::V0_9;
64
65 our @ISA;
66 push @ISA, q#SuikaWiki::Format::Definition::SuikaWiki::V0#;
67 $SuikaWiki::Format::Definition::Class{q#MAGIC:SuikaWiki/0.9\#\##} = 'SuikaWiki::Format::Definition::SuikaWiki::V0_9';
68 $SuikaWiki::Format::Definition::Class{q#IMT:text/x-suikawiki;version="0.9"\#\##} = 'SuikaWiki::Format::Definition::SuikaWiki::V0_9';
69
70 #line 1 "(WikiPlugin module source SuikaWiki09.wp2, block Format[module-name()=SuikaWiki::Format::Definition::SuikaWiki::V0_9]/Use)"
71 use Message::Markup::XML::QName qw/NS_xml_URI/;
72 use Message::Util::Error;
73 #line 251 "(WikiPlugin module SuikaWiki09, chunk from ../../bin/mkplugin2.pl)"
74 our $Converter;
75 sub convert ($$;%) {
76 my ($self, $source, %opt) = @_;
77 my $t = SuikaWiki::Format::Definition->serialize_media_type (%opt);
78 my $converter = $Converter->{$t->{_}};
79 return ($converter->{$opt{return_type} or 'Main'} or
80 CORE::die "Buggy implementation: $t->{_}/@{[$opt{return_type} or 'Main']} not defined")
81 ->($self, $source, \%opt)
82 if $converter;
83 local $Error::Depth = $Error::Depth + 1;
84 $self->SUPER::convert ($source, %opt);
85 }
86
87 #line 1 "(WikiPlugin module SuikaWiki09, chunk 2)"
88 $Converter->{q#IMT:text/html\#\#f#} = {q#Type#, q#text/html#, q#serialized_type#, q#IMT:text/html\#\#f#, q#Type_param#, {}, q#IsFragment#, q#1#, q#Main#, sub {my ($self, $source, $opt) = @_;
89 #line 1 "(WikiPlugin module source SuikaWiki09.wp2, block //Converter/Main)"
90 $opt->{o}->{wiki} ||= $self->{wiki};
91 my $xml = SuikaWiki::Plugin::plugin::SuikaWiki091051018142033w90Q->get_xml_tree (text => $source, opt => $opt,
92 wiki => $self->{wiki});
93 SuikaWiki::Plugin::plugin::SuikaWiki091051018142033w90Q->sw09_to_xhtml1 (source => $xml, parent => $opt->{-parent},
94 o => $opt->{o}, page => $opt->{page});
95 if ($opt->{-with_annotation_input}) {
96 SuikaWiki::Plugin->module_package ('WikiFormCore')
97 ->make_content_form_in_html
98 ($opt->{-parent},
99 ($WIKIRESOURCE ||= SuikaWiki::Plugin->module_package ('WikiResource'))->get
100 (name => 'SuikaWiki/0.9:form:footannotate:input',
101 o => $opt->{o}, wiki => $opt->{o}->{wiki}),
102 option => ($WIKIRESOURCE ||= SuikaWiki::Plugin->module_package ('WikiResource'))->get
103 (name => 'SuikaWiki/0.9:form:footannotate:option',
104 o => $opt->{o}, wiki => $opt->{o}->{wiki}),
105 o => $opt->{o},
106 wiki => $opt->{o}->{wiki},
107 output => {
108 page => $opt->{page},
109 });
110 }
111 #line 1 "(WikiPlugin module SuikaWiki09, chunk 3)"
112 }};
113 $Converter->{q#IMT:application/x-suikawiki+xml;version="0.9"\#\##} = {q#Type#, q#application/x-suikawiki+xml#, q#serialized_type#, q#IMT:application/x-suikawiki+xml;version="0.9"\#\##, q#Type_param#, {q#version#, q#0.9#}, q#Main#, sub {my ($self, $source, $opt) = @_;
114 #line 1 "(WikiPlugin module source SuikaWiki09.wp2, block //Converter/Main)"
115 my $xml = SuikaWiki::Plugin::plugin::SuikaWiki091051018142033w90Q->get_xml_tree (text => $source, opt => $opt,
116 wiki => $self->{wiki});
117 $opt->{-parent}->append_node ($xml);
118 #line 1 "(WikiPlugin module SuikaWiki09, chunk 4)"
119 }};
120 sub next_index_for_anchor {
121 my ($self, $source, %opt) = @_;
122 #line 1 "(WikiPlugin module source SuikaWiki09.wp2, block Format[module-name()=SuikaWiki::Format::Definition::SuikaWiki::V0_9]/NextIndex[Name=anchor])"
123 my $xml = SuikaWiki::Plugin::plugin::SuikaWiki091051018142033w90Q->get_xml_tree (text => $source, opt => \%opt,
124 wiki => $self->{wiki});
125 (SuikaWiki::Plugin::plugin::SuikaWiki091051018142033w90Q->get_last_anchor_index ($xml)) + 1;
126 #line 1 "(WikiPlugin module SuikaWiki09, chunk 5)"
127 }
128 sub wikiform {
129 my ($self, $source, %opt) = @_;
130 #line 1 "(WikiPlugin module source SuikaWiki09.wp2, block Format[module-name()=SuikaWiki::Format::Definition::SuikaWiki::V0_9]/WikiForm)"
131 my $xml = SuikaWiki::Plugin::plugin::SuikaWiki091051018142033w90Q->get_xml_tree (text => $source, opt => \%opt,
132 wiki => $self->{wiki});
133 local $opt{o}->{var}->{sw09__anchor_index};
134 local $opt{o}->{var}->{sw09__document_tree} = $xml;
135 my $form;
136 if ($opt{o}->{form}->{output}->{id}) {
137 $form = SuikaWiki::Plugin::plugin::SuikaWiki091051018142033w90Q->get_element_by_id
138 ($xml, $opt{o}->{form}->{output}->{id});
139 undef $form unless ref $form and
140 $form->namespace_uri eq q#urn:x-suika-fam-cx:markup:suikawiki:0:9:# and
141 $form->local_name eq 'form';
142 } else {
143 $form = SuikaWiki::Plugin::plugin::SuikaWiki091051018142033w90Q->get_nth_element
144 ($xml, q#urn:x-suika-fam-cx:markup:suikawiki:0:9:# => 'form',
145 $opt{o}->{form}->{output}->{index});
146 }
147 my $ref;
148 if (ref $form) {
149 $ref = $form->get_attribute_value ('ref', default => 'form');
150 } else {
151 $ref = '#footannotate';
152 }
153 if ($ref eq 'form') {
154 $opt{option} ||= $form->get_attribute_value ('option');
155 } elsif ($ref eq 'comment') {
156 $opt{option} ||= ($WIKIRESOURCE ||= SuikaWiki::Plugin->module_package ('WikiResource'))->get
157 (name => 'SuikaWiki/0.9:form:comment:option',
158 o => $opt{o}, wiki => $opt{o}->{wiki});
159 } elsif ($ref eq '#footannotate') {
160 $opt{option} ||= ($WIKIRESOURCE ||= SuikaWiki::Plugin->module_package ('WikiResource'))->get
161 (name => 'SuikaWiki/0.9:form:footannotate:option',
162 o => $opt{o}, wiki => $opt{o}->{wiki});
163 } else {
164 }
165 ($WIKIFORMCORE ||= SuikaWiki::Plugin->module_package ('WikiFormCore'))->set_option ($opt{option} => $opt{o}) if $opt{option};
166 my @missing;
167 for (keys %{$opt{o}->{form}->{require}->{id}}) {
168 unless (length $opt{o}->{wiki}->{input}->parameter
169 (($WIKIFORMCORE ||= SuikaWiki::Plugin->module_package ('WikiFormCore'))->control_id ($opt{o}, local_id => $_,
170 local_id_prefix => 'wikiform__')
171 ->{local_id})) {
172 push @missing, $_;
173 }
174 }
175 if (@missing) {
176 return [{
177 type => 'required_param_missing',
178 missing_id => \@missing,
179 }];
180 }
181 my $result;
182 if ($ref eq 'form') {
183 $opt{template} ||= $form->get_attribute_value
184 ('template', default => '');
185 } elsif ($ref eq 'comment') {
186 $opt{template} ||= ($WIKIRESOURCE ||= SuikaWiki::Plugin->module_package ('WikiResource'))->get
187 (name => 'SuikaWiki/0.9:form:comment:template',
188 o => $opt{o}, wiki => $opt{o}->{wiki});
189 } elsif ($ref eq '#footannotate') {
190 $opt{template} ||= ($WIKIRESOURCE ||= SuikaWiki::Plugin->module_package ('WikiResource'))->get
191 (name => 'SuikaWiki/0.9:form:footannotate:template',
192 o => $opt{o}, wiki => $opt{o}->{wiki});
193 }
194 try {
195 $result = SuikaWiki::Plugin->text_formatter ('form_template')
196 ->replace ($opt{template}, param => $opt{o});
197 } catch Message::Util::Formatter::error with {
198 my $err = shift;
199 SuikaWiki::Plugin->module_package ('Error')
200 ->reporting_formatting_template_error
201 ($err, $err->{option}->{param}->{wiki});
202 throw SuikaWiki::View::Implementation::error -type => 'ERROR_REPORTED';
203 };
204 if (length $result) {
205 if ($ref eq '#footannotate') {
206 my $parent;
207 for (@{$xml->child_nodes}) {
208 if ($_->node_type eq '#element' and
209 $_->local_name eq 'document') {
210 for (@{$_->child_nodes}) {
211 if ($_->node_type eq '#element' and
212 $_->local_name eq 'body') {
213 $parent = $_;
214 last;
215 }
216 }
217 }
218 }
219 CORE::die "Buggy implementation: no body element".$xml
220 unless ref $parent;
221 $parent->append_new_node (type => '#element',
222 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#,
223 local_name => 'text')
224 ->append_text ($result);
225 } else {
226 my $parent = $form->parent_node;
227 CORE::die "Byggy implementation: No parent of form" unless ref $parent;
228 my $children = $parent->child_nodes;
229 $result .= "\x0A" unless substr ($result, -1) eq "\x0A";
230 $parent->append_new_node (type => '#element',
231 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#,
232 local_name => 'text')
233 ->append_text ($result);
234 my $node = pop @{$children};
235 my $form_str = overload::StrVal ($form);
236 my $i = 0;
237 for (@{$children}) {
238 last if overload::StrVal ($_) eq $form_str;
239 $i++;
240 }
241 if ($opt{o}->{form}->{output}->{reverse}) {
242 splice @{$children}, $i + 1, 0, $node;
243 } else {
244 splice @{$children}, $i, 0, $node;
245 }
246 }
247 } else {
248 }
249 my $text = SuikaWiki::Plugin::plugin::SuikaWiki091051018142033w90Q->xml_to_text ($xml, {%opt});
250 my %fragment = (fragment => $opt{o}->{form}->{output}->{id}
251 || 'wikiform-'.$opt{o}->{form}->{output}->{index});
252 if (not $opt{o}->{form}->{output}->{reverse} and
253 $opt{o}->{var}->{sw09__anchor_index}) {
254 %fragment = (anchor_no => $opt{o}->{var}->{sw09__anchor_index});
255 }
256 my $action = [
257 {
258 type => 'write',
259 content => $text,
260 update_lastmodified => time,
261 },
262 {
263 type => 'ok',
264 %fragment,
265 },
266 ];
267 #line 1 "(WikiPlugin module SuikaWiki09, chunk 6)"
268 }
269 sub headsummary {
270 my ($self, $source, %opt) = @_;
271 #line 1 "(WikiPlugin module source SuikaWiki09.wp2, block Format[module-name()=SuikaWiki::Format::Definition::SuikaWiki::V0_9]/HeadSummary)"
272 my $xml = SuikaWiki::Plugin::plugin::SuikaWiki091051018142033w90Q->get_xml_tree (text => $source, opt => \%opt,
273 wiki => $self->{wiki});
274 return $xml->inner_text;
275 #line 1 "(WikiPlugin module SuikaWiki09, chunk 7)"
276 }
277
278 package SuikaWiki::Plugin::plugin::SuikaWiki091051018142033w90Q;
279
280 $SuikaWiki::Plugin::Rule{form_template}->{index} = {q#after#, sub {my ($f, $rule_name, $p, $o, %opt) = @_;
281
282 #line 1 "(WikiPlugin module source SuikaWiki09.wp2, block FormattingRule[name()='[q#form-template#]/index']/After)"
283 if ($o->{var}->{sw09__anchor_index}) {
284 ++$o->{var}->{sw09__anchor_index};
285 } else {
286 $o->{var}->{sw09__anchor_index}
287 = 1 + SuikaWiki::Plugin::plugin::SuikaWiki091051018142033w90Q->get_last_anchor_index
288 ($o->{var}->{sw09__document_tree});
289 }
290 $p->{-result} .= $o->{var}->{sw09__anchor_index};}, q#Parameter#, {}, q#Description#, [[q#Next anchor index number#, q#en#, q##]]}
291 #line 1 "(WikiPlugin module SuikaWiki09, chunk 8)"
292 ;
293
294
295 sub get_last_anchor_index {
296
297 #line 1 "(WikiPlugin module source SuikaWiki09.wp2, block Function[Name='get_last_anchor_index']/Main)"
298 my (undef, $xml) = @_;
299 my $anchor = 0;
300 my $get_anchor_no;
301 $get_anchor_no = sub {
302 my $node = shift;
303 for my $child (@{$node->child_nodes}) {
304 my $nt = $child->node_type;
305 if ($nt eq '#element') {
306 if ($child->namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:# and
307 $child->local_name eq 'anchor-end') {
308 my $a = $child->get_attribute_value ('anchor', default => 0,
309 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#);
310 $anchor = 0+$a if $anchor < 0+$a;
311 } else {
312 $get_anchor_no->($child);
313 }
314 } elsif ($nt eq '#document' or $nt eq '#fragment') {
315 $get_anchor_no->($child);
316 }
317 }
318 };
319 $get_anchor_no->($xml);
320 $anchor;
321 }
322
323 #line 1 "(WikiPlugin module SuikaWiki09, chunk 10)"
324
325
326
327 sub get_xml_tree {
328
329 #line 1 "(WikiPlugin module source SuikaWiki09.wp2, block Function[Name='get_xml_tree']/Main)"
330 my (undef, %opt) = @_;
331 if ($opt{opt}->{page}) {
332 unless ($SuikaWiki::Plugin::plugin::SuikaWiki091051018142033w90Q::DBLoaded) {
333 $opt{wiki}->{db}->_set_prop_db (sw09__xml_tree => {-db_open => sub {
334 require SuikaWiki::DB::Hash;
335 new SuikaWiki::DB::Hash;
336 }});
337 $SuikaWiki::Plugin::plugin::SuikaWiki091051018142033w90Q::DBLoaded++;
338 }
339 my $xml = new Message::Markup::XML::Node type => '#fragment';
340 SuikaWiki::Plugin::plugin::SuikaWiki091051018142033w90Q->text_to_xml (${$opt{text}}, {%{$opt{opt}}, -parent => $xml});
341 $opt{wiki}->{db}->set (sw09__xml_tree => $opt{opt}->{page} => $xml);
342 $xml;
343 } else {
344 my $xml = new Message::Markup::XML::Node type => '#fragment';
345 SuikaWiki::Plugin::plugin::SuikaWiki091051018142033w90Q->text_to_xml (${$opt{text}}, {%{$opt{opt}}, -parent => $xml});
346 $xml;
347 }
348 }
349
350 #line 1 "(WikiPlugin module SuikaWiki09, chunk 11)"
351
352
353
354 sub sw09_to_xhtml1 {
355
356 #line 1 "(WikiPlugin module source SuikaWiki09.wp2, block Function[Name='sw09_to_xhtml1']/Main)"
357 my (undef, %opt) = @_;
358 my ($apply_template, $apply_template_children);
359 $apply_template_children = sub {
360 for (@{$_[0]->child_nodes}) {
361 $apply_template->($_ => $_[1]) unless $_->node_type eq '#attribute';
362 }
363 };
364 $apply_template = sub {
365 my ($source, $result) = @_;
366 my $ln = $source->local_name;
367 if ($source->node_type eq '#text') {
368 $result->append_text ($source->inner_text);
369 } elsif ({qw/code 1 samp 1 var 1 dfn 1 kbd 1 sub 1 sup 1
370 cite 1 span 1/ ## SuikaWiki/0.10
371 }->{$ln}) {
372 my $node = $result->append_new_node
373 (type => '#element',
374 namespace_uri => q#http://www.w3.org/1999/xhtml#,
375 local_name => $ln);
376 my $class = $source->get_attribute_value ('class', default => '');
377 $node->set_attribute (class => $class) if $class;
378 my $lang = $source->get_attribute_value
379 ('lang', namespace_uri => NS_xml_URI);
380 if (defined $lang) {
381 $node->set_attribute (lang => $lang);
382 $node->set_attribute ('xml:lang' => $lang,
383 namespace_uri => NS_xml_URI,
384 namespace_prefix => 'xml');
385 }
386 $apply_template_children->($source => $node);
387 } elsif ({qw/ins 1 del 1 insert 1 delete 1/}->{$ln}) {
388 my $node = $result->append_new_node
389 (type => '#element',
390 namespace_uri => q#http://www.w3.org/1999/xhtml#,
391 local_name => {qw/ins ins insert ins
392 delete del del del/}->{$ln});
393 my $class = $source->get_attribute_value ('class', default => '');
394 $node->set_attribute (class => $class) if $class;
395 my $lang = $source->get_attribute_value
396 ('lang', namespace_uri => NS_xml_URI);
397 if (defined $lang) {
398 $node->set_attribute (lang => $lang);
399 $node->set_attribute ('xml:lang' => $lang,
400 namespace_uri => NS_xml_URI,
401 namespace_prefix => 'xml');
402 }
403 $apply_template_children->($source => $node);
404 } elsif ({qw/table 1 tbody 1 tr 1 td 1 blockquote 1 ul 1 ol 1
405 li 1 pre 1 dl 1 dt 1 dd 1 em 1 strong 1/}->{$ln}) {
406 my $node = $result->append_new_node
407 (type => '#element',
408 namespace_uri => q#http://www.w3.org/1999/xhtml#,
409 local_name => $ln);
410 if ($ln eq 'td') {
411 my $colspan = $source->get_attribute_value ('colspan', default => 0);
412 $node->set_attribute (colspan => $colspan) if $colspan;
413 } elsif ($ln eq 'pre') {
414 $node->set_attribute (space => 'preserve',
415 namespace_uri => NS_xml_URI);
416 my $class = $source->get_attribute_value ('class', default => '');
417 $node->set_attribute (class => $class) if length $class;
418 }
419 $apply_template_children->($source => $node);
420 } elsif ($ln eq 'anchor') {
421 local $opt{o}->{var}->{sw09__anchor_content} = sub {
422 $apply_template_children->($source => shift);
423 };
424 SuikaWiki::Plugin->module_package ('WikiLinking')
425 ->to_wikipage_in_html ({
426 label => ($WIKIRESOURCE ||= SuikaWiki::Plugin->module_package ('WikiResource'))->get_text
427 (name =>
428 'Link:SuikaWiki/0.9:toWikiPage:SourceLabel',
429 param => $opt{o},
430 wiki => $opt{o}->{wiki}),
431 } => {
432 base => $opt{o}->{wiki}->{var}->{page},
433 page_name => $opt{o}->{wiki}->name ($source->inner_text)
434 ->absolute (wiki => $opt{o}->{wiki},
435 nearest => 'content',
436 base => $opt{o}->{wiki}
437 ->{var}->{page}),
438 page_anchor_no => $source->get_attribute_value
439 ('anchor',
440 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#),
441 }, {
442 o => $opt{o},
443 parent => $result,
444 });
445 } elsif ($ln eq 'p') {
446 $apply_template_children->($source => $result->append_new_node
447 (type => '#element',
448 namespace_uri => q#http://www.w3.org/1999/xhtml#,
449 local_name => 'p'));
450 } elsif ($ln eq 'h') {
451 my $node;
452 if ($opt{o}->{var}->{ws__section_depth} > 6) {
453 $node = $result->append_new_node
454 (type => '#element',
455 namespace_uri => q#http://www.w3.org/1999/xhtml#,
456 local_name => 'div');
457 $node->set_attribute (class => 'heading h'.$opt{o}->{var}
458 ->{ws__section_depth});
459 } else {
460 $node = $result->append_new_node
461 (type => '#element',
462 namespace_uri => q#http://www.w3.org/1999/xhtml#,
463 local_name => 'h'.$opt{o}->{var}
464 ->{ws__section_depth});
465 }
466 $apply_template_children->($source => $node);
467 ($WIKISTRUCT ||= SuikaWiki::Plugin->module_package ('WikiStruct'))->set_section_id ($result, undef, $opt{o}->{wiki},
468 title => $source->inner_text);
469 } elsif ($ln eq 'ruby' or $ln eq 'rubyb') {
470 my @child;
471 for (@{$source->child_nodes}) {
472 if ({qw/rb 1 rt 1/}->{$_->local_name}) {
473 push @child, $_;
474 }
475 }
476 for ($result->append_new_node (type => '#element',
477 namespace_uri => q#http://www.w3.org/1999/xhtml#,
478 local_name => 'ruby')) {
479 if ($ln eq 'rubyb') {
480 my $class = join ' ',
481 'descriptive',
482 split /\s+/, $source->get_attribute_value
483 ('class', default => '');
484 $_->set_attribute (class => $class) if $class;
485 } else {
486 my $class = $source->get_attribute_value ('class', default => '');
487 $_->set_attribute (class => $class) if $class;
488 }
489 my $lang = $source->get_attribute_value
490 ('lang', namespace_uri => NS_xml_URI);
491 if (defined $lang) {
492 $_->set_attribute (lang => $lang);
493 $_->set_attribute ('xml:lang' => $lang,
494 namespace_uri => NS_xml_URI,
495 namespace_prefix => 'xml');
496 }
497 $apply_template_children->($child[0]
498 => $_->append_new_node (type => '#element',
499 namespace_uri => q#http://www.w3.org/1999/xhtml#,
500 local_name => 'rb'));
501 $_->append_new_node (type => '#element',
502 namespace_uri => q#http://www.w3.org/1999/xhtml#,
503 local_name => 'rp')
504 ->append_text ('(');
505 if ($child[1]) {
506 $apply_template_children->($child[1]
507 => $_->append_new_node (type => '#element',
508 namespace_uri => q#http://www.w3.org/1999/xhtml#,
509 local_name => 'rt'));
510 } else {
511 $_->append_new_node (type => '#element',
512 namespace_uri => q#http://www.w3.org/1999/xhtml#,
513 local_name => 'rt');
514 }
515 if ($child[2]) {
516 $_->append_new_node (type => '#element',
517 namespace_uri => q#http://www.w3.org/1999/xhtml#,
518 local_name => 'rp')
519 ->append_text ('/');
520 $apply_template_children->($child[2]
521 => $_->append_new_node (type => '#element',
522 namespace_uri => q#http://www.w3.org/1999/xhtml#,
523 local_name => 'rt'));
524 }
525 $_->append_new_node (type => '#element',
526 namespace_uri => q#http://www.w3.org/1999/xhtml#,
527 local_name => 'rp')
528 ->append_text (')');
529 }
530 } elsif ($ln eq 'abbr') {
531 my (@b);
532 for (@{$source->child_nodes}) {
533 push @b, $_ if {qw/rb 1 rt 1/}->{$_->local_name};
534 }
535 my $node = $result->append_new_node
536 (type => '#element',
537 namespace_uri => q#http://www.w3.org/1999/xhtml#,
538 local_name => 'abbr');
539 $node->set_attribute (title => $b[1]->inner_text) if $b[1];
540 my $lang = $source->get_attribute_value
541 ('lang', namespace_uri => NS_xml_URI);
542 if (defined $lang) {
543 $node->set_attribute (lang => $lang);
544 $node->set_attribute ('xml:lang' => $lang,
545 namespace_uri => NS_xml_URI,
546 namespace_prefix => 'xml');
547 }
548 $apply_template_children->($b[0] => $node);
549 } elsif ($ln eq 'qn') {
550 my (@b);
551 for (@{$source->child_nodes}) {
552 push @b, $_ if {qw/qname 1 nsuri 1/}->{$_->local_name};
553 }
554 my $node = $result->append_new_node
555 (type => '#element',
556 namespace_uri => q#http://www.w3.org/1999/xhtml#,
557 local_name => 'code');
558 $node->set_attribute (class => 'qname');
559 my $lang = $source->get_attribute_value
560 ('lang', namespace_uri => NS_xml_URI);
561 if (defined $lang) {
562 $node->set_attribute (lang => $lang);
563 $node->set_attribute ('xml:lang' => $lang,
564 namespace_uri => NS_xml_URI,
565 namespace_prefix => 'xml');
566 }
567 $node->set_attribute (title => '{<'.$b[1]->inner_text.'>}') if $b[1];
568 $apply_template_children->($b[0] => $node);
569 } elsif ($ln eq 'q') {
570 my $node = $result->append_new_node
571 (type => '#element',
572 namespace_uri => q#http://www.w3.org/1999/xhtml#,
573 local_name => 'q');
574 my $lang = $source->get_attribute_value
575 ('lang', namespace_uri => NS_xml_URI);
576 if (defined $lang) {
577 $node->set_attribute (lang => $lang);
578 $node->set_attribute ('xml:lang' => $lang,
579 namespace_uri => NS_xml_URI,
580 namespace_prefix => 'xml');
581 }
582 $apply_template_children->($source => $node);
583 } elsif ($ln eq 'weak' or
584 $ln eq 'aa' ## SuikaWiki/0.10
585 ) {
586 my $node = $result->append_new_node
587 (type => '#element',
588 namespace_uri => q#http://www.w3.org/1999/xhtml#,
589 local_name => 'span');
590 my @class = split /\s+/,
591 $source->get_attribute_value ('class', default => '');
592 $node->set_attribute (class => join ' ', $ln, @class);
593 my $lang = $source->get_attribute_value
594 ('lang', namespace_uri => NS_xml_URI);
595 if (defined $lang) {
596 $node->set_attribute (lang => $lang);
597 $node->set_attribute ('xml:lang' => $lang,
598 namespace_uri => NS_xml_URI,
599 namespace_prefix => 'xml');
600 }
601 $apply_template_children->($source => $node);
602 } elsif ($ln eq 'src') { ## SuikaWiki/0.10
603 my $node = $result->append_new_node
604 (type => '#element',
605 namespace_uri => q#http://www.w3.org/1999/xhtml#,
606 local_name => 'cite');
607 my @class = split /\s+/,
608 $source->get_attribute_value ('class', default => '');
609 $node->set_attribute (class => join ' ', $ln, @class);
610 my $lang = $source->get_attribute_value
611 ('lang', namespace_uri => NS_xml_URI);
612 if (defined $lang) {
613 $node->set_attribute (lang => $lang);
614 $node->set_attribute ('xml:lang' => $lang,
615 namespace_uri => NS_xml_URI,
616 namespace_prefix => 'xml');
617 }
618 $node->append_text ("[");
619 $apply_template_children->($source => $node);
620 $node->append_text ("]");
621 } elsif ($ln eq 'csection') { ## SuikaWiki/0.10
622 my $node = $result->append_new_node
623 (type => '#element',
624 namespace_uri => q#http://www.w3.org/1999/xhtml#,
625 local_name => 'cite');
626 my @class = split /\s+/,
627 $source->get_attribute_value ('class', default => '');
628 $node->set_attribute (class => join ' ', $ln, @class);
629 $apply_template_children->($source => $node);
630 } elsif ($ln eq 'key') { ## SuikaWiki/0.10
631 my $node = $result->append_new_node
632 (type => '#element',
633 namespace_uri => q#http://www.w3.org/1999/xhtml#,
634 local_name => 'kbd');
635 my @class = split /\s+/,
636 $source->get_attribute_value ('class', default => '');
637 $node->set_attribute (class => join ' ', $ln, @class);
638 my $lang = $source->get_attribute_value
639 ('lang', namespace_uri => NS_xml_URI);
640 if (defined $lang) {
641 $node->set_attribute (lang => $lang);
642 $node->set_attribute ('xml:lang' => $lang,
643 namespace_uri => NS_xml_URI,
644 namespace_prefix => 'xml');
645 }
646 $apply_template_children->($source => $node);
647 } elsif ({qw/section 1 bodytext 1/}->{$ln}) {
648 my $node = $result->append_new_node
649 (type => '#element',
650 namespace_uri => q#http://www.w3.org/1999/xhtml#,
651 local_name => 'div');
652 $node->set_attribute (class => $ln);
653 local $opt{o}->{var}->{ws__section_depth}
654 = $opt{o}->{var}->{ws__section_depth} + 1;
655 $apply_template_children->($source => $node);
656 } elsif ($ln eq 'anchor-end') {
657 my $node = $result->append_new_node
658 (type => '#element',
659 namespace_uri => q#http://www.w3.org/1999/xhtml#,
660 local_name => 'a');
661 $node->set_attribute (id => 'anchor-'.$source->get_attribute_value
662 ('anchor', default => '0',
663 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#));
664 $node->set_attribute (name => 'anchor-'.$source->get_attribute_value
665 ('anchor', default => '0',
666 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#))
667 if $opt{o}->{wiki}->{var}->{client}->{downgrade}->{html_no_id};
668 $node->set_attribute (class => 'anchor');
669 $node->append_text ($source->inner_text);
670 } elsif ($ln eq 'anchor-internal') {
671 my $node = $result->append_new_node
672 (type => '#element',
673 namespace_uri => q#http://www.w3.org/1999/xhtml#,
674 local_name => 'a');
675 $node->set_attribute (href => '#anchor-'.$source->get_attribute_value
676 ('anchor',
677 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#, default => '0'));
678 $node->set_attribute (class => 'wiki-anchor');
679 $node->append_text ($source->inner_text);
680 } elsif ($ln eq 'anchor-external') {
681 local $opt{o}->{var}->{sw09__anchor_content} = sub {
682 $apply_template_children->($source => shift);
683 };
684 ($WIKILINKING ||= SuikaWiki::Plugin->module_package ('WikiLinking'))
685 ->to_resource_in_html (
686 {
687 label => ($WIKIRESOURCE ||= SuikaWiki::Plugin->module_package ('WikiResource'))
688 ->get_text (name =>
689 'Link:SuikaWiki/0.9:toResource:SourceLabel',
690 param => $opt{o},
691 wiki => $opt{o}->{wiki}),
692 }, {
693 resource_scheme =>
694 $source->get_attribute_value ('resScheme',
695 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#,
696 default => 'URI'),
697 resource_parameter =>
698 $source->get_attribute_value ('resParameter',
699 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#,
700 default => ''),
701 }, {
702 o => $opt{o},
703 parent => $result,
704 });
705 } elsif ($ln eq 'form') {
706 my $ref = $source->get_attribute_value ('ref', default => 'form');
707 if ($ref eq 'form') {
708 ($WIKIFORMCORE ||= SuikaWiki::Plugin->module_package ('WikiFormCore'))->make_content_form_in_html
709 ($result,
710 $source->get_attribute_value
711 ('input', default => ''),
712 option => $source->get_attribute_value
713 ('option'),
714 name => $source->get_attribute_value ('id'),
715 o => $opt{o},
716 wiki => $opt{o}->{wiki},
717 output => {
718 page => $opt{page},
719 });
720 } elsif ($ref eq 'comment') {
721 ($WIKIFORMCORE ||= SuikaWiki::Plugin->module_package ('WikiFormCore'))->make_content_form_in_html
722 ($result,
723 ($WIKIRESOURCE ||= SuikaWiki::Plugin->module_package ('WikiResource'))->get
724 (name => 'SuikaWiki/0.9:form:comment:input',
725 o => $opt{o}, wiki => $opt{o}->{wiki}),
726 option => ($WIKIRESOURCE ||= SuikaWiki::Plugin->module_package ('WikiResource'))->get
727 (name => 'SuikaWiki/0.9:form:comment:option',
728 o => $opt{o}, wiki => $opt{o}->{wiki}),
729 name => $source->get_attribute_value ('id'),
730 o => $opt{o},
731 wiki => $opt{o}->{wiki},
732 output => {
733 page => $opt{page},
734 });
735 } else {
736 ($WIKIFORMCORE ||= SuikaWiki::Plugin->module_package ('WikiFormCore'))->make_content_form_in_html
737 ($result,
738 '',
739 option => '',
740 o => $opt{o},
741 wiki => $opt{o}->{wiki},
742 output => {
743 page => $opt{page},
744 });
745 }
746 } elsif ($ln eq 'dr') {
747 $apply_template_children->($source => $result);
748 } elsif ($ln eq 'replace') {
749 $result->append_text
750 ('__&&' . $source->get_attribute_value
751 ('by', default => '') . '&&__');
752 } elsif ($ln eq 'ed' or $ln eq 'comment-p') { ## SuikaWiki/0.10 additions
753 my $ed = $result->append_new_node
754 (type => '#element',
755 namespace_uri => q#http://www.w3.org/1999/xhtml#,
756 local_name => 'div');
757 $ed->set_attribute (class => $ln);
758 $apply_template_children->($source => $ed->append_new_node
759 (type => '#element',
760 namespace_uri => q#http://www.w3.org/1999/xhtml#,
761 local_name => 'p'));
762 } elsif ($ln eq 'document') {
763 my $body;
764 for (@{$source->child_nodes}) {
765 $body = $_ and last if $_->local_name eq 'body';
766 }
767 my $body_block = $result->append_new_node
768 (type => '#element',
769 namespace_uri => q#http://www.w3.org/1999/xhtml#,
770 local_name => 'div');
771 $body_block->set_attribute (class => 'block SuikaWiki-0-9');
772 $apply_template_children->($body => $body_block);
773 } else {
774 my $node = $result->append_new_node
775 (type => '#element',
776 namespace_uri => q#http://www.w3.org/1999/xhtml#,
777 local_name => 'span');
778 $node->set_attribute (class => 'warn');
779 for ($node->append_new_node
780 (type => '#element',
781 namespace_uri => q#http://www.w3.org/1999/xhtml#,
782 local_name => 'ins')
783 ->append_new_node
784 (type => '#element',
785 namespace_uri => q#http://www.w3.org/1999/xhtml#,
786 local_name => 'code')) {
787 $_->set_attribute (class => 'XML element');
788 $_->append_text ("<".$source->namespace_uri.">:$ln");
789 }
790 $apply_template_children->($source => $node);
791 }
792 };
793 $apply_template_children->($opt{source} => $opt{parent});
794 }
795
796 #line 1 "(WikiPlugin module SuikaWiki09, chunk 12)"
797
798
799
800 sub xml_to_text {
801
802 #line 1 "(WikiPlugin module source SuikaWiki09.wp2, block Function[Name='xml_to_text']/Main)"
803 my (undef, $src, $opt) = @_;
804 my %is_block = (
805 qw/p 1 blockquote 1 pre 1 ul 1 ol 1 dl 1 section 1 h 1
806 bodytext 1 document 1 head 1 body 1 table 1 text 1 form 1
807 insert 1 delete 1 ed 1 comment-p 1/
808 );
809 my %x2t;
810 %x2t = (
811 anchor => sub {
812 my $source = shift;
813 my $result = '[['
814 . $x2t{'#inline'}->($source, no_newline => 1)
815 . ']';
816 my $anchor = $source->get_attribute_value
817 ('anchor',
818 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#,
819 default => '');
820 if (length $anchor) {
821 $result .= '>>'.(0+$anchor);
822 } else {
823 $anchor = $source->get_attribute_value
824 ('resScheme',
825 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#);
826 if ($anchor) {
827 my $param = $source->get_attribute_value
828 ('resParameter',
829 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#);
830 if ($anchor eq 'URI' and $param =~ /^[0-9A-Za-z_+.%-]+:/) {
831 $result .= '<' . $param . '>';
832 } else {
833 $result .= '<' . $anchor . ':' . $param . '>';
834 }
835 }
836 }
837 $result . ']';
838 },
839 li => sub {
840 my $source = shift;
841 my $result = ({qw/ul - ol =/}->{$opt->{o}->{var}->{sw09__list_type}}
842 x $opt->{o}->{var}->{sw09__list_depth})
843 . ' ' . $x2t{'#flow'}->($source);
844 $result;
845 },
846 dt => sub {
847 ':' . $x2t{'#inline'}->(return, no_newline => 1) . ':';
848 },
849 h => sub {
850 ("*" x ($opt->{o}->{var}->{ws__section_depth} - 1))
851 . " "
852 . $x2t{'#inline'}->(shift, no_newline => 1);
853 },
854 'anchor-end' => sub {
855 return shift->inner_text;
856 },
857 'anchor-internal' => sub {
858 return shift->inner_text;
859 },
860 'anchor-external' => sub {
861 return '<'.shift->inner_text.'>';
862 },
863 form => sub {
864 my $source = shift;
865 my $ref = $source->get_attribute_value ('ref', default => 'form');
866 my $result = '[[#'.$ref;
867 my $name = $source->get_attribute_value ('id');
868 $name =~ s/([()\\])/\\$1/g;
869 $result .= '(' . $name . ')' if $name;
870 if ($ref eq 'form') {
871 $result .= ":'";
872 my $input = $source->get_attribute_value ('input', default => '');
873 $input =~ s/(['\\])/\\$1/g;
874 $result .= $input . "':'";
875 my $template = $source->get_attribute_value ('template', default => '');
876 $template =~ s/(['\\])/\\$1/g;
877 $result .= $template . "'";
878 my $option = $source->get_attribute_value ('option');
879 if ($option) {
880 $option =~ s/(['\\])/\\$1/g;
881 $result .= ":'" . $option . "'";
882 }
883 } else {
884 my $param = $source->get_attribute_value ('parameter');
885 if ($param) {
886 $result .= ':' . $param;
887 }
888 }
889 $result .= ']]';
890 },
891 pre => sub {
892 my $source = shift;
893 my $result = '[PRE';
894 my $class = $source->get_attribute_value ('class');
895 if ($class) {
896 $class =~ s/([\\()])/\\$1/g;
897 $result .= '(' . $class . ')';
898 }
899 $result .= "[\x0A"
900 . $x2t{'#inline'}->($source);
901 $result .= "\x0A" unless substr ($result, -1) eq "\x0A";
902 $result .= "]PRE]\x0A";
903 },
904 insert => sub {
905 my $source = shift;
906 my $result = '[INS';
907 my $class = $source->get_attribute_value ('class');
908 if ($class) {
909 $class =~ s/([\\()])/\\$1/g;
910 $result .= '(' . $class . ')';
911 }
912 local $opt->{o}->{var}->{sw09__list_depth} = 0;
913 $result .= "[\x0A"
914 . $x2t{'#block'}->($source);
915 $result .= "\x0A" unless substr ($result, -1) eq "\x0A";
916 $result .= "]INS]\x0A";
917 },
918 delete => sub {
919 my $source = shift;
920 my $result = '[DEL';
921 my $class = $source->get_attribute_value ('class');
922 if ($class) {
923 $class =~ s/([\\()])/\\$1/g;
924 $result .= '(' . $class . ')';
925 }
926 local $opt->{o}->{var}->{sw09__list_depth} = 0;
927 $result .= "[\x0A"
928 . $x2t{'#block'}->($source);
929 $result .= "\x0A" unless substr ($result, -1) eq "\x0A";
930 $result .= "]DEL]\x0A";
931 },
932 document => sub {
933 my $source = shift;
934 my $result = '';
935 $result = '#?'
936 . $source->get_attribute_value
937 ('Name', namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#,
938 default => 'SuikaWiki')
939 . '/'
940 . $source->get_attribute_value
941 ('Version', namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#,
942 default => '0.9');
943 for (@{$source->child_nodes}) {
944 $result .= ($x2t{$_->local_name} or $x2t{'#undef'})->($_)
945 if $_->node_type eq '#element';
946 if ($_->local_name eq 'head') {
947 $result = '' if $result eq "#?SuikaWiki/0.9\x0A";
948 }
949 }
950 $result;
951 },
952 head => sub {
953 my $source = shift;
954 my $result = '';
955 for (@{$source->child_nodes}) {
956 if ($_->node_type eq '#element' and
957 $_->local_name eq 'parameter') {
958 $result .= ' '.$x2t{parameter}->($_);
959 }
960 }
961 $result . "\x0A";
962 },
963 parameter => sub {
964 my $source = shift;
965 my $result = $source->get_attribute_value ('name', default => '')
966 . '="';
967 my @v;
968 for (@{$source->child_nodes}) {
969 push @v, $x2t{value}->($_) if $_->node_type eq '#element' and
970 $_->local_name eq 'value';
971 }
972 $result .= join ',', @v;
973 $result . '"';
974 },
975 value => sub {
976 my $value = $x2t{'#inline'}->(shift, no_newline => 1);
977 $value =~ s/(["\\])/\\$1/g;
978 $value =~ tr/\x0A\x0D/ /;
979 $value;
980 },
981 section => sub {
982 local $opt->{o}->{var}->{ws__section_depth}
983 = $opt->{o}->{var}->{ws__section_depth} + 1;
984 $x2t{'#block'}->(shift);
985 },
986 body => sub {
987 local $opt->{o}->{var}->{ws__section_depth} = 1;
988 $x2t{'#block'}->(shift);
989 },
990 text => sub {
991 my ($source, %opt) = @_;
992 my $result .= '';
993 for (@{$source->child_nodes}) {
994 if ($_->node_type eq '#text') {
995 $result .= $_->inner_text;
996 } elsif ($_->node_type eq '#element') {
997 $result .= ($x2t{$_->local_name} or $x2t{'#undef'})->($_);
998 }
999 }
1000 $result;
1001 },
1002 dr => sub {
1003 my $result = $x2t{'#list'}->(shift);
1004 if ($result) {
1005 $result . "\x0A";
1006 } else {
1007 "::\x0A";
1008 }
1009 },
1010 dt => sub {
1011 ':' . $x2t{'#inline'}->(shift, no_newline => 1) . ':';
1012 },
1013 dd => sub {
1014 $x2t{'#inline'}->(shift);
1015 },
1016 tr => sub {
1017 my $result = $x2t{'#list'}->(shift);
1018 if ($result) {
1019 substr ($result, 1) . "\x0A";
1020 } else {
1021 "',\x0A";
1022 }
1023 },
1024 td => sub {
1025 my $source = shift;
1026 my $result = $x2t{'#inline'}->($source, no_newline => 1);
1027 if ($result =~ /[,"\\]/ or $result =~ /==/) {
1028 $result =~ s/(["\\])/\\$1/g;
1029 $result = '"' . $result . '"';
1030 }
1031 my $colspan = $source->get_attribute_value ('colspan', default => 1);
1032 $result .= ("\t,==" x ($colspan - 1)) if $colspan > 1;
1033 "\t," . $result;
1034 },
1035 em => sub {
1036 "''" . $x2t{'#inline'}->($_, no_newline => 1) . "''";
1037 },
1038 strong => => sub {
1039 "'''" . $x2t{'#inline'}->($_, no_newline => 1) . "'''";
1040 },
1041 rb => sub {
1042 $x2t{'#inline'}->(shift, no_newline => 1);
1043 },
1044 qname => sub {
1045 $x2t{'#inline'}->(shift, no_newline => 1);
1046 },
1047 rt => sub {
1048 my $lang = $_[0]->get_attribute_value
1049 ('lang', namespace_uri => NS_xml_URI,
1050 default => '');
1051 $lang = '@' . $lang if length $lang;
1052 '] '.$lang.'[' . $x2t{'#inline'}->(shift, no_newline => 1);
1053 },
1054 nsuri => sub {
1055 my $lang = $_[0]->get_attribute_value
1056 ('lang', namespace_uri => NS_xml_URI,
1057 default => '');
1058 $lang = '@' . $lang if length $lang;
1059 '] '.$lang.'[' . $x2t{'#inline'}->(shift, no_newline => 1);
1060 },
1061 replace => sub {
1062 '__&&' . shift->get_attribute_value ('by', default => '') . '&&__';
1063 },
1064 bodytext => sub {
1065 my ($source, %opt) = @_;
1066 local $opt->{o}->{var}->{sw09__bq_depth}
1067 = $opt->{o}->{var}->{sw09__bq_depth} + 1;
1068 my @result;
1069 for (@{$source->child_nodes}) {
1070 if ($_->node_type eq '#element') {
1071 my $ln = $_->local_name;
1072 push @result, [($x2t{$ln} or $x2t{'#undef'})->($_),
1073 $ln];
1074 }
1075 }
1076 my $result = '';
1077 my $prev = '';
1078 for (@result) {
1079 my $s = $_->[0];
1080 if ($_->[1] eq 'p' or $_->[1] eq 'ed' or $_->[1] eq 'comment-p') {
1081 $result .= "\x0A" if length $result and
1082 substr ($result, -1) ne "\x0A";
1083 $result .= ('>' x $opt->{o}->{var}->{sw09__bq_depth}) . ' ';
1084 } elsif ($_->[1] eq 'form' or $_->[1] eq 'replace') {
1085 $result .= "\x0A" if length $result and
1086 substr ($result, -1) ne "\x0A";
1087 $result .= ('>' x $opt->{o}->{var}->{sw09__bq_depth})."\x0A";
1088 } elsif ($_->[1] eq 'blockquote' or $_->[1] eq 'text') {
1089 $result .= "\x0A" if length $result and
1090 substr ($result, -1) ne "\x0A";
1091 } else {
1092 unless ($prev eq 'text') {
1093 $result .= "\x0A" if length $result and
1094 substr ($result, -1) ne "\x0A";
1095 }
1096 $result .= ('>' x $opt->{o}->{var}->{sw09__bq_depth})."\x0A";
1097 }
1098 $result .= $s;
1099 $prev = $_->[1];
1100 }
1101 $result;
1102 },
1103 image => sub {
1104 my ($source, %opt) = @_;
1105 return "\x0A__IMAGE__\x0A" . $source->inner_text . "\x0A";
1106 },
1107 'ed' => sub {
1108 my ($source, %opt) = @_;
1109 '@@ ' . $x2t{'#flow'}->($source);
1110 },
1111 'comment-p' => sub {
1112 my ($source, %opt) = @_;
1113 ';; ' . $x2t{'#flow'}->($source);
1114 },
1115 '#block' => sub {
1116 my ($source, %opt) = @_;
1117 my @result;
1118 for (@{$source->child_nodes}) {
1119 if ($_->node_type eq '#element') {
1120 my $ln = $_->local_name;
1121 push @result, [($x2t{$ln} or $x2t{'#undef'})->($_),
1122 $ln];
1123 }
1124 }
1125 my $result = '';
1126 my $prev = '';
1127 for (@result) {
1128 my $s = $_->[0];
1129 if ($_->[1] eq 'form') {
1130 $result .= "\x0A" if length $result and
1131 substr ($result, -1) ne "\x0A";
1132 $result .= "\x0A";
1133 } elsif ($_->[1] eq 'replace') {
1134 $result .= "\x0A" if length $result and
1135 substr ($result, -1) ne "\x0A";
1136 } elsif ($_->[1] eq 'text') {
1137 $result .= "\x0A" if length $result and
1138 substr ($result, -1) ne "\x0A";
1139 $result .= "\x0A" if $prev eq 'p' or $prev eq 'ed' or
1140 $prev eq 'comment-p';
1141 } else {
1142 if ($prev ne 'text' and $prev ne 'replace') {
1143 $result .= "\x0A" if length $result and
1144 substr ($result, -1) ne "\x0A";
1145 $result .= "\x0A";
1146 }
1147 }
1148 $result .= $s;
1149 $prev = $_->[1];
1150 }
1151 $result;
1152 },
1153 '#flow' => sub {
1154 my ($source, %opt) = @_;
1155 my @result;
1156 for (@{$source->child_nodes}) {
1157 if ($_->node_type eq '#element') {
1158 my $ln = $_->local_name;
1159 if ($is_block{$ln}) {
1160 push @result, [($x2t{$ln} or $x2t{'#undef'})->($_),
1161 $ln];
1162 } else {
1163 if (@result and ($result[$#result]->[1] eq '#inline')) {
1164 $result[$#result]->[0]
1165 .= ($x2t{$ln} or $x2t{'#undef'})->($_);
1166 } else {
1167 push @result, [($x2t{$ln} or $x2t{'#undef'})->($_),
1168 '#inline'];
1169 }
1170 }
1171 } elsif ($_->node_type eq '#text') {
1172 if (@result and ($result[$#result]->[1] eq '#inline')) {
1173 $result[$#result]->[0] .= $_->inner_text;
1174 } else {
1175 push @result, [$_->inner_text, '#inline'];
1176 }
1177 }
1178 }
1179 my $result = '';
1180 my $prev = '';
1181 for (@result) {
1182 my $s = $_->[0];
1183 if ($_->[1] eq '#inline') {
1184 if ($prev ne 'text' and $prev ne 'form' and $prev ne 'replace') {
1185 $result .= "\x0A" if length $result and
1186 substr ($result, -1) ne "\x0A";
1187 }
1188 $s =~ s/\x0D\x0A/\x0A/g;
1189 $s =~ s/\x0D/\x0A/g;
1190 $s =~ s/\x0A\x0A+/\x0A/g;
1191 $s =~ s/\x0A/\x20/g if $opt{no_newline};
1192 } elsif ($_->[1] eq 'form' or $_->[1] eq 'replace') {
1193 if ($prev ne '#inline') {
1194 $result .= "\x0A" if length $result and
1195 substr ($result, -1) ne "\x0A";
1196 }
1197 } elsif ($_->[1] eq 'text') {
1198 $result .= "\x0A" if length $result and
1199 substr ($result, -1) ne "\x0A";
1200 } else {
1201 unless ($prev eq 'text') {
1202 $result .= "\x0A" if length $result and
1203 substr ($result, -1) ne "\x0A";
1204 }
1205 }
1206 $result .= $s;
1207 $prev = $_->[1];
1208 }
1209 $result;
1210 },
1211 '#inline' => sub {
1212 my ($source, %opt) = @_;
1213 my $result .= '';
1214 for (@{$source->child_nodes}) {
1215 if ($_->node_type eq '#text') {
1216 $result .= $_->inner_text;
1217 } elsif ($_->node_type eq '#element') {
1218 $result .= ($x2t{$_->local_name} or $x2t{'#undef'})->($_);
1219 }
1220 }
1221 $result =~ s/\x0D\x0A/\x0A/g;
1222 $result =~ s/\x0D/\x0A/g;
1223 $result =~ s/\x0A\x0A+/\x0A/g;
1224 $result =~ s/\x0A/\x20/g if $opt{no_newline};
1225 $result;
1226 },
1227 '#list' => sub {
1228 my ($source, %opt) = @_;
1229 my $result .= '';
1230 for (@{$source->child_nodes}) {
1231 if ($_->node_type eq '#element') {
1232 $result .= ($x2t{$_->local_name} or $x2t{'#undef'})->($_);
1233 }
1234 }
1235 $result;
1236 },
1237 '#undef' => sub {
1238 my $source = shift;
1239 "<".$source->namespace_uri.">:".$source->local_name
1240 . $x2t{'#inline'}->($source);
1241 },
1242 );
1243 for (qw/blockquote dl tbody table/) {
1244 $x2t{$_} = sub { $x2t{'#list'}->(shift) };
1245 }
1246 for (qw/p dd/) {
1247 $x2t{$_} = sub { $x2t{'#flow'}->(shift) };
1248 }
1249 for my $type (qw/ul ol/) {
1250 $x2t{$type} = sub {
1251 my $source = shift;
1252 local $opt->{o}->{var}->{sw09__list_type} = $type;
1253 local $opt->{o}->{var}->{sw09__list_depth}
1254 = $opt->{o}->{var}->{sw09__list_depth} + 1;
1255 my @result;
1256 for (@{$source->child_nodes}) {
1257 push @result, $x2t{$_->local_name}->($_)
1258 if $_->node_type eq '#element';
1259 }
1260 my $result = '';
1261 for (@result) {
1262 $result .= "\x0A" unless substr ($result, -1) eq "\x0A";
1263 $result .= $_;
1264 }
1265 substr ($result, 1);
1266 };
1267 }
1268 for my $type (qw/code samp var dfn kbd sub sup weak q ruby rubyb
1269 abbr ins del aa src cite key qn csection span/) {
1270 $x2t{$type} = sub {
1271 my $source = shift;
1272 my $result = '['.uc $type;
1273 my $class = $source->get_attribute_value ('class', default => '');
1274 if ($class) {
1275 $class =~ s/([()\\])/\\$1/g;
1276 $result .= '(' . $class . ')';
1277 }
1278 my $lang = $source->get_attribute_value
1279 ('lang', namespace_uri => NS_xml_URI);
1280 if (defined $lang) {
1281 $result .= '@' . $lang;
1282 }
1283 $result .= '['
1284 . $x2t{'#inline'}->($source, no_newline => 1)
1285 . ']';
1286 my $anchor = $source->get_attribute_value
1287 ('anchor',
1288 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#,
1289 default => '');
1290 if (length $anchor) {
1291 $result .= '>>'.(0+$anchor);
1292 } else {
1293 $anchor = $source->get_attribute_value
1294 ('resScheme',
1295 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#);
1296 if ($anchor) {
1297 my $param = $source->get_attribute_value
1298 ('resParameter',
1299 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#);
1300 if ($anchor eq 'URI' and $param =~ /^[0-9A-Za-z_+.%-]+:/) {
1301 $result .= '<' . $param . '>';
1302 } else {
1303 $result .= '<' . $anchor . ':' . $param . '>';
1304 }
1305 }
1306 }
1307 $result .= ']';
1308 $result;
1309 };
1310 }
1311 $x2t{'#list'}->($src);
1312 }
1313
1314 #line 1 "(WikiPlugin module SuikaWiki09, chunk 13)"
1315
1316
1317
1318 sub get_nth_element {
1319
1320 #line 1 "(WikiPlugin module source SuikaWiki09.wp2, block Function[Name='get_nth_element']/Main)"
1321 my (undef, $node, $ns => $ln, $n) = @_;
1322 return $n if $n < 1;
1323 if ($node->node_type eq '#element' and
1324 $node->namespace_uri eq $ns and
1325 $node->local_name eq $ln) {
1326 return $node unless --$n;
1327 }
1328 for (@{$node->child_nodes}) {
1329 if ($_->node_type eq '#element') {
1330 if ($_->namespace_uri eq $ns and
1331 $_->local_name eq $ln) {
1332 return $_ unless --$n;
1333 } else {
1334 $n = SuikaWiki::Plugin::plugin::SuikaWiki091051018142033w90Q->get_nth_element ($_, $ns => $ln, $n);
1335 return $n if ref $n;
1336 }
1337 } elsif ($_->node_type eq '#fragment' or $_->node_type eq '#document') {
1338 $n = SuikaWiki::Plugin::plugin::SuikaWiki091051018142033w90Q->get_nth_element ($_, $ns => $ln, $n);
1339 return $n if ref $n;
1340 }
1341 }
1342 return $n;
1343 }
1344
1345 #line 1 "(WikiPlugin module SuikaWiki09, chunk 14)"
1346
1347
1348
1349 sub get_element_by_id {
1350
1351 #line 1 "(WikiPlugin module source SuikaWiki09.wp2, block Function[Name='get_element_by_id']/Main)"
1352 my (undef, $node, $id) = @_;
1353 return $node if $node->node_type eq '#element'
1354 and $node->get_attribute_value ('id', default_value => '')
1355 eq $id;
1356 for (@{$node->child_nodes}) {
1357 if ({'#element'=>1, '#fragment'=>1, '#document'=>1}->{$_->node_type}) {
1358 my $r = SuikaWiki::Plugin::plugin::SuikaWiki091051018142033w90Q->get_element_by_id ($_, $id);
1359 return $r if $r;
1360 }
1361 }
1362 }
1363
1364 #line 1 "(WikiPlugin module SuikaWiki09, chunk 15)"
1365
1366
1367
1368 sub text_to_xml {
1369
1370 #line 1 "(WikiPlugin module source SuikaWiki09.wp2, block Function[Name='text_to_xml']/Main)"
1371 my (undef, $source, $opt) = @_;
1372 $source =~ s/\x0D\x0A/\x0A/g;
1373 $source =~ tr/\x0D/\x0A/;
1374 $source .= "\x0A";
1375 my $root = $opt->{-parent}
1376 ->append_new_node (type => '#element',
1377 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#,
1378 local_name => 'document');
1379 my $head = $root->append_new_node (type => '#element',
1380 namespace_uri => q#http://www.w3.org/2002/06/xhtml2/#,
1381 local_name => 'head');
1382 $root->append_text ("\x0A");
1383 my $body = $root->append_new_node (type => '#element',
1384 namespace_uri => q#http://www.w3.org/2002/06/xhtml2/#,
1385 local_name => 'body');
1386 $root->append_text ("\x0A");
1387 if ($source =~ s#^\#\?(SuikaWiki(?:Image)?)/0\.9\b((?>.*))\s*##) {
1388 my $type = $1;
1389 my $param = $2;
1390 $root->set_attribute (Name => $type, namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#);
1391 $root->set_attribute (Version => '0.9', namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#);
1392 while ($param =~ /\G\s+([a-z-]+)="((?>[^"\\]*)(?>(?>[^"\\]+|\\.)*))"/g) {
1393 my ($name, $value) = ($1, $2);
1394 $value =~ s/\\(.)/$1/g;
1395 for ($head->append_new_node (type => '#element',
1396 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#,
1397 local_name => 'parameter')) {
1398 $_->set_attribute (name => $name);
1399 for my $value (split /,/, $value) {
1400 $_->append_new_node (type => '#element',
1401 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#,
1402 local_name => 'value')
1403 ->append_text ($value);
1404 }
1405 }
1406 $head->append_text ("\x0A");
1407 }
1408 if ($type eq 'SuikaWikiImage') {
1409 $source =~ s/\x0A__IMAGE__\x0A(.*)$//s;
1410 if (my $image = $1) {
1411 $image =~ s/^\s+//;
1412 $image =~ s/\s+$//;
1413 $root->append_new_node
1414 (type => '#element',
1415 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#,
1416 local_name => 'image')
1417 ->append_text ($image);
1418 $root->append_text ("\x0A");
1419 }
1420 }
1421 } else {
1422 }
1423 SuikaWiki::Plugin::plugin::SuikaWiki091051018142033w90Q->block_text_to_xml (\$source => $body, opt => $opt);
1424 }
1425
1426 #line 1 "(WikiPlugin module SuikaWiki09, chunk 16)"
1427
1428
1429
1430 sub block_text_to_xml {
1431
1432 #line 1 "(WikiPlugin module source SuikaWiki09.wp2, block Function[Name='block_text_to_xml']/Main)"
1433 my (undef, $source, $current, %opt) = @_;
1434 my %depth = %{$opt{depth} || {}};
1435 my $back_to_section = sub {
1436 my $cur_type = $current->local_name;
1437 while (not (
1438 $cur_type eq 'section'
1439 or $cur_type eq 'body'
1440 or $cur_type eq 'bodytext'
1441 or $cur_type eq 'insert'
1442 or $cur_type eq 'delete'
1443 )
1444 ) {
1445 $current = $current->parent_node;
1446 $cur_type = $current->local_name;
1447 }
1448 delete $depth{list};
1449 };
1450 my $back_to_real_section = sub {
1451 my $cur_type = $current->local_name;
1452 while (not (
1453 $cur_type eq 'section'
1454 or $cur_type eq 'body'
1455 or $cur_type eq 'insert'
1456 or $cur_type eq 'delete'
1457 )
1458 ) {
1459 $current = $current->parent_node;
1460 $cur_type = $current->local_name;
1461 }
1462 delete $depth{bq};
1463 delete $depth{list};
1464 };
1465 while ($$source =~ /\G([^\x0A]*)\x0A/gc) {
1466 my $line = $1;
1467 if ($line eq '') {
1468 $back_to_real_section->();
1469 } elsif ($line =~ s/^([-=]+)\s*//) {
1470 my $list_type = substr ($1, -1) eq '-' ? 'ul' : 'ol';
1471 my $depth = length $1;
1472 my $parent_type = $current->parent_node->local_name;
1473 if ($parent_type eq 'ul' or $parent_type eq 'ol') {
1474 if ($depth{list} == $depth) {
1475 if ($parent_type eq $list_type) {
1476 $current = $current->parent_node;
1477 } else {
1478 $current = $current->parent_node
1479 ->parent_node
1480 ->append_new_node
1481 (type => '#element',
1482 namespace_uri => q#http://www.w3.org/2002/06/xhtml2/#,
1483 local_name => $list_type);
1484 }
1485 } elsif ($depth < $depth{list}) {
1486 for ($depth+1..$depth{list}) {
1487 $current = $current->parent_node->parent_node;
1488 }
1489 $current = $current->parent_node;
1490 if ($current->local_name ne $list_type) {
1491 $current = $current->parent_node
1492 ->append_new_node
1493 (type => '#element',
1494 namespace_uri => q#http://www.w3.org/2002/06/xhtml2/#,
1495 local_name => $list_type);
1496 }
1497 $depth{list} = $depth;
1498 } else { # $depth{list} < $depth
1499 $current = $current->append_new_node
1500 (type => '#element',
1501 namespace_uri => q#http://www.w3.org/2002/06/xhtml2/#,
1502 local_name => $list_type);
1503 $depth{list}++;
1504 }
1505 } else {
1506 $current = $current->append_new_node (type => '#element',
1507 namespace_uri => q#http://www.w3.org/2002/06/xhtml2/#,
1508 local_name => $list_type);
1509 $depth{list} = 1;
1510 }
1511 $current->append_text ("\x0A".(" " x $depth{list}));
1512 $current = $current->append_new_node (type => '#element',
1513 namespace_uri => q#http://www.w3.org/2002/06/xhtml2/#,
1514 local_name => 'li');
1515 SuikaWiki::Plugin::plugin::SuikaWiki091051018142033w90Q->inline_text_to_xml (\$line => $current, %opt);
1516 } elsif ($line =~ s/^(\*+)\s*//) {
1517 my $depth = length $1;
1518 $back_to_real_section->();
1519 if ($depth <= $depth{section}) {
1520 for ($depth..$depth{section}) {
1521 $back_to_real_section->();
1522 $current = $current->parent_node;
1523 }
1524 $depth{section} = $depth;
1525 } else { # $depth{section} < $depth
1526 for ($depth{section}+2..$depth) {
1527 $current = $current->append_new_node
1528 (type => '#element',
1529 namespace_uri => q#http://www.w3.org/2002/06/xhtml2/#,
1530 local_name => 'section');
1531 }
1532 $depth{section} = $depth;
1533 }
1534 $current = $current->append_new_node
1535 (type => '#element',
1536 namespace_uri => q#http://www.w3.org/2002/06/xhtml2/#,
1537 local_name => 'section');
1538 SuikaWiki::Plugin::plugin::SuikaWiki091051018142033w90Q->inline_text_to_xml (\$line =>
1539 $current->append_new_node (type => '#element',
1540 namespace_uri => q#http://www.w3.org/2002/06/xhtml2/#,
1541 local_name => 'h'), %opt,
1542 );
1543 } elsif ($line =~ s/^(?!>>[0-9])(>+)\s*//) {
1544 my $depth = length $1;
1545 if ($depth <= $depth{bq}) {
1546 for ($depth+1..$depth{bq}) {
1547 $back_to_section->();
1548 $current = $current->parent_node->parent_node;
1549 }
1550 $back_to_section->();
1551 $current->append_text ("\x0A");
1552 $depth{bq} = $depth;
1553 } else { # $depth{bq} < $depth
1554 $back_to_section->();
1555 for ($depth{bq}+1..$depth) {
1556 $current = $current->append_new_node
1557 (type => '#element',
1558 namespace_uri => q#http://www.w3.org/2002/06/xhtml2/#,
1559 local_name => 'blockquote')
1560 ->append_new_node
1561 (type => '#element',
1562 namespace_uri => q#urn:x-suika-fam-cx:markup:ietf:html:3:draft:00:#,
1563 local_name => 'bodytext');
1564 $current->append_text ("\x0A");
1565 }
1566 $depth{bq} = $depth;
1567 }
1568 if (length $line) {
1569 if ($line =~ s/^\@\@\s*//) {
1570 $current = $current->append_new_node
1571 (type => '#element',
1572 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:10:#,
1573 local_name => 'ed');
1574 } elsif ($line =~ s/^;;\s*//) {
1575 $current = $current->append_new_node
1576 (type => '#element',
1577 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:10:#,
1578 local_name => 'comment-p');
1579 } else {
1580 $current = $current->append_new_node
1581 (type => '#element',
1582 namespace_uri => q#http://www.w3.org/2002/06/xhtml2/#,
1583 local_name => 'p');
1584 }
1585 SuikaWiki::Plugin::plugin::SuikaWiki091051018142033w90Q->inline_text_to_xml (\$line => $current, %opt);
1586 }
1587 } elsif ($line =~ s/^(?>:\s*)([^:]+?)\s*:\s*//) {
1588 my $parent_type = $current->local_name;
1589 if ($parent_type eq 'dd') {
1590 $current = $current->parent_node->parent_node;
1591 $current->append_text ("\x0A");
1592 } else { #if ($parent_type ne 'dl') {
1593 $current = $current->append_new_node (type => '#element',
1594 namespace_uri => q#http://www.w3.org/2002/06/xhtml2/#,
1595 local_name => 'dl');
1596 }
1597 $current = $current->append_new_node
1598 (type => '#element',
1599 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#,
1600 local_name => 'dr');
1601 SuikaWiki::Plugin::plugin::SuikaWiki091051018142033w90Q->inline_text_to_xml (\"$1" =>
1602 $current->append_new_node (type => '#element',
1603 namespace_uri => q#http://www.w3.org/2002/06/xhtml2/#,
1604 local_name => 'dt'), %opt,
1605 );
1606 $current->append_text ("\x0A");
1607 $current = $current->append_new_node (type => '#element',
1608 namespace_uri => q#http://www.w3.org/2002/06/xhtml2/#,
1609 local_name => 'dd');
1610 SuikaWiki::Plugin::plugin::SuikaWiki091051018142033w90Q->inline_text_to_xml (\$line => $current, %opt);
1611 } elsif ($line =~ /^\[(INS|DEL)(?>(\([^()\\]*\))?)\[\s*$/) {
1612 $current->append_text ("\x0A");
1613 my $mod = $current->append_new_node
1614 (type => '#element',
1615 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#,
1616 local_name => {qw/INS insert DEL delete/}->{$1});
1617 $mod->set_attribute (class => $2) if $2;
1618 SuikaWiki::Plugin::plugin::SuikaWiki091051018142033w90Q->block_text_to_xml ($source => $mod, %opt,
1619 'return_by_'.$1 => 1,
1620 depth => \%depth);
1621 } elsif ($line =~ /^\](INS|DEL)\]\s*$/) {
1622 if ($opt{'return_by_'.$1}) {
1623 return;
1624 } else {
1625 }
1626 } elsif ($line =~ /^\[PRE(?>(?>\(((?>[^()\\]*)(?>(?>[^()\\]+|\\.)*))\))?)\[\s*$/) {
1627 $current->append_text ("\x0A");
1628 my $pre = $current->append_new_node (type => '#element',
1629 namespace_uri => q#http://www.w3.org/1999/xhtml#,
1630 local_name => 'pre');
1631 $pre->set_attribute (class => $1) if $1;
1632 $pre->set_attribute (space => 'preserve', namespace_uri => NS_xml_URI);
1633 my $f = 1;
1634 while ($$source =~ /\G([^\x0A]*)\x0A/gc) {
1635 my $line = $1;
1636 if ($line =~ /^\]PRE\]\s*$/) {
1637 undef $pre;
1638 last;
1639 } else {
1640 $f ? undef $f : $pre->append_text ("\x0A");
1641 SuikaWiki::Plugin::plugin::SuikaWiki091051018142033w90Q->inline_text_to_xml (\$line => $pre, %opt);
1642 }
1643 }
1644 if (ref $pre) {
1645 }
1646 } elsif ($line =~ /^\s/) {
1647 $current->append_text ("\x0A");
1648 my $pre = $current->append_new_node (type => '#element',
1649 namespace_uri => q#http://www.w3.org/1999/xhtml#,
1650 local_name => 'pre');
1651 $pre->set_attribute (space => 'preserve', namespace_uri => NS_xml_URI);
1652 SuikaWiki::Plugin::plugin::SuikaWiki091051018142033w90Q->inline_text_to_xml (\$line => $pre, %opt);
1653 while ($$source =~ /\G([^\x0A]*)\x0A/gc) {
1654 my $line = $1;
1655 if (length $line == 0) {
1656 pos ($$source) -= 1;
1657 last;
1658 } elsif ($opt{return_by_INS} and $line =~ /^\]INS\]\s*$/) {
1659 return;
1660 } elsif ($opt{return_by_DEL} and $line =~ /^\]DEL\]\s*$/) {
1661 return;
1662 } else {
1663 $pre->append_text ("\x0A");
1664 SuikaWiki::Plugin::plugin::SuikaWiki091051018142033w90Q->inline_text_to_xml (\$line => $pre, %opt);
1665 }
1666 }
1667 } elsif ($line =~ /^,/) {
1668 $current->append_text ("\x0A");
1669 my $tbody = $current->append_new_node (type => '#element',
1670 namespace_uri => q#http://www.w3.org/2002/06/xhtml2/#,
1671 local_name => 'table')
1672 ->append_new_node (type => '#element',
1673 namespace_uri => q#http://www.w3.org/2002/06/xhtml2/#,
1674 local_name => 'tbody');
1675 SuikaWiki::Plugin::plugin::SuikaWiki091051018142033w90Q->tablerow_text_to_xml (\$line => $tbody, %opt);
1676 while ($$source =~ /\G(,[^\x0A]*)\x0A/gc) {
1677 SuikaWiki::Plugin::plugin::SuikaWiki091051018142033w90Q->tablerow_text_to_xml (\"$1" => $tbody, %opt);
1678 }
1679 } else {
1680 my $current_type = $current->local_name;
1681 if ($current_type eq 'section'
1682 or $current_type eq 'body'
1683 or $current_type eq 'bodytext'
1684 or $current_type eq 'insert'
1685 or $current_type eq 'delete') {
1686 $current->append_text ("\x0A");
1687 if ($line =~ s/^__&&([^&]+)&&__//) {
1688 $current->append_new_node (type => '#element',
1689 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#,
1690 local_name => 'replace')
1691 ->set_attribute (by => $1);
1692 } elsif ($line =~ s/^\[\[$Reg_Form_Content_M\]\]//o) {
1693 for ($current->append_new_node (type => '#element',
1694 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#,
1695 local_name => 'form')) {
1696 $_->set_attribute (id => $1) if $1;
1697 my ($i, $t, $o) = ($2, $3 || '', $4 || '');
1698 s/\\(.)/$1/g for ($i, $t, $o);
1699 $_->set_attribute (input => $i);
1700 $_->set_attribute (template => $t);
1701 $_->set_attribute (option => $o);
1702 }
1703 } elsif ($line =~ s/^\[\[$Reg_Embed_Content_M\]\]//o) {
1704 for ($current->append_new_node (type => '#element',
1705 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#,
1706 local_name => 'form')) {
1707 $_->set_attribute (ref => $1);
1708 $_->set_attribute (id => $2) if $2;
1709 $_->set_attribute (parameter => $3) if defined $3;
1710 }
1711 }
1712 if (length $line) {
1713 if ($line =~ s/^\@\@\s*//) {
1714 $current = $current->append_new_node
1715 (type => '#element',
1716 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:10:#,
1717 local_name => 'ed');
1718 } elsif ($line =~ s/^;;\s*//) {
1719 $current = $current->append_new_node
1720 (type => '#element',
1721 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:10:#,
1722 local_name => 'comment-p');
1723 } else {
1724 $current = $current->append_new_node
1725 (type => '#element',
1726 namespace_uri => q#http://www.w3.org/2002/06/xhtml2/#,
1727 local_name => 'p');
1728 }
1729 SuikaWiki::Plugin::plugin::SuikaWiki091051018142033w90Q->inline_text_to_xml (\$line => $current, %opt);
1730 }
1731 } else {
1732 $current->append_text ("\x0A"); # replacement of prev.line's \n
1733 SuikaWiki::Plugin::plugin::SuikaWiki091051018142033w90Q->inline_text_to_xml (\$line => $current, %opt);
1734 }
1735 }
1736 }
1737 if ($opt{return_by_INS} or $opt{return_by_DEL}) {
1738 }
1739 }
1740
1741 #line 1 "(WikiPlugin module SuikaWiki09, chunk 17)"
1742
1743
1744
1745 sub tablerow_text_to_xml {
1746
1747 #line 1 "(WikiPlugin module source SuikaWiki09.wp2, block Function[Name='tablerow_text_to_xml']/Main)"
1748 my (undef, $source => $current, %opt) = @_;
1749 $current->append_text ("\x0A");
1750 $current = $current->append_new_node (type => '#element',
1751 namespace_uri => q#http://www.w3.org/2002/06/xhtml2/#,
1752 local_name => 'tr');
1753 my $prev_cell;
1754 while ($$source =~ /\G,\s*/gc) {
1755 $$source =~ /\G([^,"][^,]*|"(?>[^"\\]*)(?>(?>[^"\\]+|\\.)*)"\s*)/gc;
1756 my $cell = $1;
1757 if ($cell =~ s/^"//) {
1758 $cell =~ s/"\s*$//g;
1759 $cell =~ s/\\(.)/$1/g;
1760 } else {
1761 $cell =~ s/\s+$//g;
1762 if ($cell eq '==') {
1763 if (ref $prev_cell) {
1764 $prev_cell->set_attribute (colspan =>
1765 $prev_cell->get_attribute_value ('colspan', default => 1)
1766 + 1);
1767 next;
1768 } else {
1769 }
1770 }
1771 }
1772 $prev_cell = $current->append_new_node
1773 (type => '#element',
1774 namespace_uri => q#http://www.w3.org/2002/06/xhtml2/#,
1775 local_name => 'td');
1776 SuikaWiki::Plugin::plugin::SuikaWiki091051018142033w90Q->inline_text_to_xml (\$cell => $prev_cell, %opt);
1777 }
1778 }
1779
1780 #line 1 "(WikiPlugin module SuikaWiki09, chunk 18)"
1781
1782
1783
1784 sub inline_text_to_xml {
1785
1786 #line 1 "(WikiPlugin module source SuikaWiki09.wp2, block Function[Name='inline_text_to_xml']/Main)"
1787 my (undef, $source => $current, %opt) = @_;
1788 my $ElementDef = {
1789 ABBR => {ln => 'abbr', ns_uri => q#http://www.w3.org/2002/06/xhtml2/#},
1790 CODE => {ln => 'code', ns_uri => q#http://www.w3.org/2002/06/xhtml2/#},
1791 DEL => {ln => 'del', ns_uri => q#http://www.w3.org/1999/xhtml#},
1792 DFN => {ln => 'dfn', ns_uri => q#http://www.w3.org/2002/06/xhtml2/#},
1793 INS => {ln => 'ins', ns_uri => q#http://www.w3.org/1999/xhtml#},
1794 KBD => {ln => 'kbd', ns_uri => q#http://www.w3.org/2002/06/xhtml2/#},
1795 Q => {ln => 'q', ns_uri => q#http://www.w3.org/1999/xhtml#},
1796 RUBY => {ln => 'ruby', ns_uri => q#http://www.w3.org/2002/06/xhtml2/#},
1797 RUBYB => {ln => 'rubyb', ns_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#},
1798 SAMP => {ln => 'samp', ns_uri => q#http://www.w3.org/2002/06/xhtml2/#},
1799 SUB => {ln => 'sub', ns_uri => q#http://www.w3.org/2002/06/xhtml2/#},
1800 SUP => {ln => 'sup', ns_uri => q#http://www.w3.org/2002/06/xhtml2/#},
1801 VAR => {ln => 'var', ns_uri => q#http://www.w3.org/2002/06/xhtml2/#},
1802 WEAK => {ln => 'weak', ns_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#},
1803 AA => {ln => 'aa', ns_uri => q#http://pc5.2ch.net/test/read.cgi/hp/1096723178/aavocab\##}, ## SuikaWiki/0.10
1804 CITE => {ln => 'cite', ns_uri => q#http://www.w3.org/2002/06/xhtml2/#}, ## SuikaWiki/0.10
1805 CSECTION => {ln => 'csection', ns_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:10:#}, ## SuikaWiki/0.10
1806 KEY => {ln => 'key', ns_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:10:#}, ## SuikaWiki/0.10
1807 QN => {ln => 'qn', ns_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:10:#}, ## SuikaWiki/0.10
1808 SPAN => {ln => 'span', ns_uri => q#http://www.w3.org/2002/06/xhtml2/#}, ## SuikaWiki/0.10
1809 SRC => {ln => 'src', ns_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:10:#}, ## SuikaWiki/0.10
1810 anchor => {ln => 'anchor', ns_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#, has_fragment_no => 1},
1811 del => {has_cite => 1},
1812 ins => {has_cite => 1},
1813 nsuri => {ln => 'nsuri', ns_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:10:#, is_nested => 1},
1814 q => {has_cite => 1},
1815 qname => {ln => 'qname', ns_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:10:#, is_nested => 1},
1816 rb => {ln => 'rb', ns_uri => q#http://www.w3.org/2002/06/xhtml2/#, is_nested => 1},
1817 rt => {ln => 'rt', ns_uri => q#http://www.w3.org/2002/06/xhtml2/#, is_nested => 1},
1818 };
1819 if ($$source =~ /\G\[([0-9]+)\]/gc) {
1820 for ($current->append_new_node (type => '#element',
1821 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#,
1822 local_name => 'anchor-end')) {
1823 $_->set_attribute (anchor => 0+$1,
1824 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#);
1825 $_->append_text ('['.$1.']');
1826 }
1827 }
1828 my $depth = 0;
1829 while (pos $$source < length $$source) {
1830 if ($$source =~ /\G\[\[(?=\#)/gc) {
1831 my $form = $current->append_new_node (type => '#element',
1832 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#,
1833 local_name => 'form');
1834 if ($$source =~ /\G$Reg_Form_Content_M\]\]/ogc) {
1835 $form->set_attribute (id => $1) if $1;
1836 my ($i, $t, $o) = ($2, $3, $4);
1837 s/\\(.)/$1/g for ($i, $t, $o);
1838 $form->set_attribute (input => $i);
1839 $form->set_attribute (template => $t);
1840 $form->set_attribute (option => $o);
1841 } elsif ($$source =~ /\G$Reg_Embed_Content_M\]\]/ogc) {
1842 $form->set_attribute (ref => $1);
1843 $form->set_attribute (id => $2) if $2;
1844 $form->set_attribute (parameter => $3) if defined $3;
1845 } else {
1846 SuikaWiki::Plugin->module_package('Error')->report_error_simple ($opt{opt}->{o}->{wiki}, InvalidForm => substr ($$source, pos ($$source)));
1847 }
1848 } elsif ($$source =~ /\G\[(?>([A-Z]+)(?>\(((?>[^()\\]*)(?>(?>[^()\\]+|\\.)*))\))?)?(?:\@([A-Za-z0-9-]+))?\[/gc) {
1849 my $type = $1 || 'anchor';
1850 my $param = $2;
1851 my $lang = $3;
1852 my $def = $ElementDef->{ $type };
1853 unless ($def) {
1854 $def = $ElementDef->{CODE};
1855 }
1856 $current = $current->append_new_node (type => '#element',
1857 namespace_uri => $def->{ns_uri},
1858 local_name => $def->{ln});
1859 $current->set_attribute (class => $param) if $param;
1860 $current->set_attribute (lang => $lang, namespace_uri => NS_xml_URI)
1861 if defined $lang;
1862 if ($type eq 'RUBY' or $type eq 'RUBYB'
1863 or $type eq 'ABBR') {
1864 $current = $current->append_new_node
1865 (type => '#element',
1866 namespace_uri => $ElementDef->{rb}->{ns_uri},
1867 local_name => $ElementDef->{rb}->{ln});
1868 } elsif ($type eq 'QN') {
1869 $current = $current->append_new_node
1870 (type => '#element',
1871 namespace_uri => $ElementDef->{qname}->{ns_uri},
1872 local_name => $ElementDef->{qname}->{ln});
1873 }
1874 $depth++;
1875 } elsif ($$source =~ /\G\](?> <([0-9A-Za-z_+.%-]+):($Reg_URI_Opaque)>
1876 | >>([0-9]+) )?
1877 \]/gcox) {
1878 my ($scheme, $opaque, $anchor) = ($1, $2, $3);
1879 unless ($depth) {
1880 $current->append_text (substr ($$source, $-[0], $+[0]-$-[0]));
1881 next;
1882 }
1883 my $def = $ElementDef->{$current->local_name} || {};
1884 if (defined $anchor) {
1885 $current->set_attribute (anchor => $anchor + 0,
1886 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#);
1887 } elsif (defined $scheme) {
1888 if ($scheme =~ /[A-Z]/) {
1889 $current->set_attribute (resScheme => $scheme,
1890 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#);
1891 $current->set_attribute (resParameter => $opaque,
1892 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#);
1893 } else {
1894 $current->set_attribute (resScheme => 'URI',
1895 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#);
1896 $current->set_attribute (resParameter => "$scheme:$opaque",
1897 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#);
1898 }
1899 }
1900 $current = $current->parent_node;
1901 $current = $current->parent_node if $def->{is_nested};
1902 $depth--;
1903 } elsif ($$source =~ /\G\]\s*(?:\@([A-Za-z0-9-]+))?\[/gc) {
1904 my $lang = $1;
1905 if ($current->local_name eq 'rb' or $current->local_name eq 'rt') {
1906 $current = $current->parent_node
1907 ->append_new_node
1908 (type => '#element',
1909 namespace_uri => $ElementDef->{rt}->{ns_uri},
1910 local_name => $ElementDef->{rt}->{ln});
1911 $current->set_attribute (lang => $lang, namespace_uri => NS_xml_URI)
1912 if defined $lang;
1913 } elsif ($current->local_name eq 'qname') {
1914 $current = $current->parent_node
1915 ->append_new_node
1916 (type => '#element',
1917 namespace_uri => $ElementDef->{nsuri}->{ns_uri},
1918 local_name => $ElementDef->{nsuri}->{ln});
1919 $current->set_attribute (lang => $lang, namespace_uri => NS_xml_URI)
1920 if defined $lang;
1921 } else {
1922 $current->append_text (substr ($$source, $-[0], $+[0]-$-[0]-1));
1923 pos ($$source)--;
1924 }
1925 } elsif ($$source =~ /\G'''?/gc) {
1926 my $type = $+[0] - $-[0] == 3 ? 'strong' : 'em';
1927 if ($current->local_name eq $type) {
1928 $current = $current->parent_node;
1929 } else {
1930 $current = $current->append_new_node
1931 (type => '#element',
1932 namespace_uri => q#http://www.w3.org/2002/06/xhtml2/#,
1933 local_name => $type);
1934 }
1935 } elsif ($$source =~ /\G<([0-9A-Za-z_+.%-]+):($Reg_URI_Opaque)>/gco) {
1936 my ($scheme, $data) = ($1, $2);
1937 my $link = $current->append_new_node
1938 (type => '#element',
1939 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#,
1940 local_name => 'anchor-external');
1941 if (substr ($scheme, 0, 1) =~ /[A-Z]/) {
1942 $link->set_attribute (resScheme => $scheme,
1943 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#);
1944 $link->set_attribute (resParameter => $data,
1945 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#);
1946 } else { # URI Reference
1947 $link->set_attribute (resScheme => 'URI',
1948 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#);
1949 $link->set_attribute (resParameter => $scheme.':'.$data,
1950 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#);
1951 }
1952 $link->append_text ($scheme.':'.$data);
1953 } elsif ($$source =~ /\G__&&/gc) {
1954 if ($$source =~ /\G([^&]+)&&__/gc) {
1955 $current->append_new_node
1956 (type => '#element',
1957 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#,
1958 local_name => 'replace')
1959 ->set_attribute (by => $1);
1960 } else {
1961 $current->append_text ('__&&');
1962 }
1963 } elsif ($$source =~ /\G((?>
1964 [^'\[\]<>_]+
1965 | ' (?!')
1966 | \[ (?!\[|[A-Z]+(?>\([^()\\]*
1967 (?>[^()\\]+|\\.)*\))?
1968 (?>\@[A-Za-z0-9-]+)?\[)
1969 | \] (?! \]
1970 | >>[0-9]+\]
1971 | <[0-9A-Za-z_+.%-]+:$Reg_URI_Opaque>\]
1972 | \s*(?:\@[A-Za-z0-9-]+)?\[ )
1973 | < (?![0-9A-Za-z_+.%-]+:$Reg_URI_Opaque>)
1974 | > (?!>[0-9])
1975 | _ (?!_&&)
1976 )+)/oxgc) {
1977 $current->append_text ($1);
1978 } elsif ($$source =~ /\G>>([0-9]+)/gc) {
1979 for ($current->append_new_node (type => '#element',
1980 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#,
1981 local_name => 'anchor-internal')) {
1982 $_->set_attribute (anchor => 0+$1,
1983 namespace_uri => q#urn:x-suika-fam-cx:markup:suikawiki:0:9:#);
1984 $_->append_text ('>>'.$1);
1985 }
1986 } else {
1987 CORE::die "Implementation buggy: ", substr ($$source, pos $$source);
1988 }
1989 }
1990 }
1991
1992 #line 1 "(WikiPlugin module SuikaWiki09, chunk 19)"
1993
1994
1995 {my $def = {q#Parameter#, {}, q#Description#, [[q#Output content of the anchor element#, q#en#, q##]], q#main#, sub {my ($f, $rule_name, $p, $o, %opt) = @_;
1996
1997 #line 1 "(WikiPlugin module source SuikaWiki09.wp2, block FormattingRule[name()='[q#page-link#, q#link-to-resource#]/sw09__link_anchor_content']/Formatting)"
1998 if ($o->{var}->{sw09__anchor_content}) {
1999 $o->{var}->{sw09__anchor_content}->($p->{-parent});
2000 } else {
2001 ($WIKIRESOURCE ||= SuikaWiki::Plugin->module_package ('WikiResource'))->append_tree
2002 (name => 'Link:SuikaWiki/0.9:link-anchor-content:InvalidContext',
2003 param => $o,
2004 -parent => $p->{-parent},
2005 wiki => $o->{wiki});
2006 }}}
2007 #line 1 "(WikiPlugin module SuikaWiki09, chunk 20)"
2008 ;
2009 $SuikaWiki::Plugin::Rule{page_link}->{sw09__link_anchor_content} = $def;
2010 $SuikaWiki::Plugin::Rule{link_to_resource}->{sw09__link_anchor_content} = $def;
2011 };
2012
2013 package SuikaWiki::Plugin::Resource;
2014
2015 our $BaseResource;
2016 $BaseResource->{q#en#}->{q##}->{q#Link:SuikaWiki/0.9:link-anchor-content:InvalidContext#} = q#%percent;sw09--link-anchor-content; cannot be used in this context.#;
2017 $BaseResource->{q#en#}->{q##}->{q#Link:SuikaWiki/0.9:toResource:SourceLabel#} = q#%select_link_resource_scheme ( URI => {<%link-to-it( label=>{%link-resource-parameters;}p, );>}, IW => {%iw--source-label (default => {<%link-to-it ( label => {%link-resource-scheme;:%link-resource-parameters;}p, );});}, MAIL => {<%link-to-it( label => {%link-resource-parameters;}p, description => {%res (name=>{Link:MailAddress=});<%link-resource-parameters;>}p, );>}, otherwise => {<%link-to-it( label => {%sw09--link-anchor-content;}p, description => {%res (name=>{Link:URIReference=});<%uri-reference;>}p, );>}, );#;
2018 $BaseResource->{q#und#}->{q##}->{q#Link:SuikaWiki/0.9:toWikiPage:SourceLabel#} = q#%link-to-it( label=>{%sw09--link-anchor-content;%if-linked-wikipage-exist( true=>{%if-link-has-dest-anchor-no(true=>{>>%link-dest-anchor-no;});}, false=>{%res(name=>{Link:toWikiPage:NotExist:Mark});} );}p, description=>{%page-name(absolute);; %if-linked-wikipage-exist( true=>{%page-headline;}, false=>{(%res(name=>{Link:toWikiPage:NotExist:Description});)}, );}p, class=>{%if-linked-wikipage-exist(false=>{not-exist});}p, );#;
2019 $BaseResource->{q#und#}->{q##}->{q#SuikaWiki/0.9:form:comment:input#} = q#%line (content => {%textarea (id=>msg,size=>20,lines=>3);}p); %line (content => { (%text (description => {%res (name => {Form:Description:HumanName});}p, id => name, size => 6); [%text (description => {%res (name => {Form:Description:MailAddress});}p, id => mail, size => 5);] %check (default, id => record-date, label => {%res (name => {Form:Label:LogDate});}p, description => {%res (name => {Form:Description:LogDate});}p);) %submit (label => {%res (name => {Form:Label:Add});}p, description => {%res (name => {Form:Description:Add});}p); %we--update-lastmodified-datetime; }p);#;
2020 $BaseResource->{q#und#}->{q##}->{q#SuikaWiki/0.9:form:comment:template#} = q#%n ;[%index;]%n ;%text(source=>msg);%n;(%name;%text(source=>mail,prefix=>" [",suffix=>"]");%iif(source=>record-date,true=>" [WEAK[%date;]]");)%n;#;
2021 $BaseResource->{q#und#}->{q##}->{q#SuikaWiki/0.9:form:comment:option#} = q#%require (msg);#;
2022 $BaseResource->{q#und#}->{q##}->{q#SuikaWiki/0.9:form:footannotate:input#} = q#%line (content => {%textarea (id=>msg,size=>20,lines=>3);}p); %line (content => { (%text (description => {%res (name => {Form:Description:HumanName});}p, id => name, size => 6); [%text (description => {%res (name => {Form:Description:MailAddress});}p, id => mail, size => 5);] %check (default, id => record-date, label => {%res (name => {Form:Label:LogDate});}p, description => {%res (name => {Form:Description:LogDate});}p);) %submit (label => {%res (name => {Form:Label:Add});}p, description => {%res (name => {Form:Description:Add});}p); %we--update-lastmodified-datetime; }p);#;
2023 $BaseResource->{q#und#}->{q##}->{q#SuikaWiki/0.9:form:footannotate:template#} = q#%n ;[%index;]%n ;%text(source=>msg);%n ;(%name;%text(source=>mail,prefix=>" [",suffix=>"]");%iif(source=>record-date,true=>" [WEAK[%date;]]");)%n;#;
2024 $BaseResource->{q#und#}->{q##}->{q#SuikaWiki/0.9:form:footannotate:option#} = q#%require (msg);#;
2025 $BaseResource->{q#en#}->{q##}->{q#WikiFormat:MediaType:Description:IMT:text/x-suikawiki;version="0.9"\#\##} = q#SuikaWiki/0.9 (text format), as used in SuikaWiki 2#;
2026 $BaseResource->{q#en#}->{q##}->{q#WikiFormat:MediaType:Description:IMT:text/x-suikawiki;version="0.10"\#\##} = q#SuikaWiki/0.10 (text format)#;
2027 $BaseResource->{q#en#}->{q##}->{q#WikiFormat:MediaType:Label:IMT:text/x-suikawiki;version="0.9"\#\##} = q#SuikaWiki/0.9 (text)#;
2028 $BaseResource->{q#en#}->{q##}->{q#WikiFormat:MediaType:Label:IMT:text/x-suikawiki;version="0.10"\#\##} = q#SuikaWiki/0.10 (text)#;
2029 $BaseResource->{q#en#}->{q##}->{q#WikiFormat:MediaType:Description:MAGIC:SuikaWiki/0.9\#\##} = q#SuikaWiki/0.9 (text format), as used in SuikaWiki 2#;
2030 $BaseResource->{q#en#}->{q##}->{q#WikiFormat:MediaType:Description:MAGIC:SuikaWiki/0.10\#\##} = q#SuikaWiki/0.10 (text format)#;
2031 $BaseResource->{q#en#}->{q##}->{q#WikiFormat:MediaType:Label:MAGIC:SuikaWiki/0.9\#\##} = q#SuikaWiki/0.9 (text format)#;
2032 $BaseResource->{q#en#}->{q##}->{q#WikiFormat:MediaType:Label:MAGIC:SuikaWiki/0.10\#\##} = q#SuikaWiki/0.10 (text)#;
2033 package SuikaWiki::Plugin::Registry;
2034
2035 $Info{q#SuikaWiki09#}->{provide} = {q#rule#, {q#link_to_resource#, [q#sw09__link_anchor_content#], q#form_template#, [q#index#], q#page_link#, [q#sw09__link_anchor_content#]}};
2036
2037 1;

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24