/[pub]/suikawiki/script/wiki.cgi
Suika

Diff of /suikawiki/script/wiki.cgi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.25 by wakaba, Sat Sep 28 09:43:07 2002 UTC revision 1.26 by wakaba, Sat Sep 28 10:54:27 2002 UTC
# Line 110  my $SearchPage = 'SearchPage'; Line 110  my $SearchPage = 'SearchPage';
110  my $CreatePage = 'CreatePage';  my $CreatePage = 'CreatePage';
111  my $ErrorPage = 'ErrorPage';  my $ErrorPage = 'ErrorPage';
112  my $RssPage = 'RssPage';  my $RssPage = 'RssPage';
113    my $NAME_OF_WikiPageLicense = 'WikiPageLicense';
114  my $AdminSpecialPage = 'Admin Special Page'; # must include spaces.  my $AdminSpecialPage = 'Admin Special Page'; # must include spaces.
115  ##############################  ##############################
116  # my $wiki_name = '\b([A-Z][a-z]+([A-Z][a-z]+)+)\b';        # Walrus del (2)  # my $wiki_name = '\b([A-Z][a-z]+([A-Z][a-z]+)+)\b';        # Walrus del (2)
# Line 204  sub main { Line 205  sub main {
205  }  }
206    
207  sub do_read {  sub do_read {
208      &print_header($form{mypage});    &print_header($form{mypage});
209      &print_content($database{$form{mypage}});    my $content = $database{$form{mypage}};
210      print &text_to_html (q([[#comment]]));      my $cf = 'SuikaWiki/0.9';
211      my ($r, $c) = get_search_result ($form{mypage});      $cf = $1 if $content =~ s#^(?:/\*\s*|\#\?)?([A-Z][A-Za-z0-9-]+/[0-9.]+(?:\s[^\x0D\x0A]+)?)[\x0D\x0A]+##s;
212        if ($cf =~ m#^SuikaWiki/0.9(?:$|\s)#) {
213          &print_content($content, $cf);
214          print &text_to_html (q([[#comment]]));
215        } else {
216          print "<pre>@{[&escape($content)]}</pre>";
217        }
218      my ($r, $c) = get_search_result ($form{mypage});
219      if ($c) {      if ($c) {
220        print q{<h2>See also</h2>};        print q{<h2 id="SEE-ALSO">See also</h2>};
221        print $r;        print $r;
222      }      }
223      &print_footer($form{mypage});    &print_footer($form{mypage});
224  }  }
225    
226  sub do_output_css {  sub do_output_css {
# Line 376  sub get_search_result ($;%) { Line 384  sub get_search_result ($;%) {
384          || index ($page, $word) > 0          || index ($page, $word) > 0
385          || index ($word, $page) > 0          || index ($word, $page) > 0
386         ) {         ) {
387        $r .= qq(<li><a href ="$url_cgi?@{[&encode($page)]}">@{[&escape($page)]}</a>@{[&escape(&get_subjectline($page))]}</li>);        $r .= qq(<li><a href ="$url_cgi?@{[&encode($page)]}" class="wiki">@{[&escape($page)]}</a>@{[&escape(&get_subjectline($page))]}</li>);
388        $counter++;        $counter++;
389      }      }
390    }    }
# Line 440  Content-Style-Type: text/css Line 448  Content-Style-Type: text/css
448  <head>  <head>
449      <title>$escapedpage @{[&escape(&get_subjectline($page))]}</title>      <title>$escapedpage @{[&escape(&get_subjectline($page))]}</title>
450      <link rel="index" href="$url_cgi?$IndexPage">      <link rel="index" href="$url_cgi?$IndexPage">
451        <link rel="copyright" href="$url_cgi?$NAME_OF_WikiPageLicense">
452      <link rev="made" href="mailto:@{[&escape($modifier_mail)]}">      <link rev="made" href="mailto:@{[&escape($modifier_mail)]}">
453      <link rel="stylesheet" type="text/css" href="@{[&escape($url_stylesheet)]}">      <link rel="stylesheet" type="text/css" href="@{[&escape($url_stylesheet)]}">
454  </head>  </head>
# Line 552  sub unescape { Line 561  sub unescape {
561      return $s;      return $s;
562  }  }
563    
564  sub print_content {  sub print_content ($;$) {
565      my ($rawcontent) = @_;      my ($rawcontent, $format) = @_;
     $rawcontent =~ s#^SuikaWiki/0.9[^\x0D\x0A]*[\x0D\x0A]+##s;  
566      print &text_to_html($rawcontent, toc=>1);      print &text_to_html($rawcontent, toc=>1);
567  }  }
568    
# Line 609  sub text_to_html { Line 617  sub text_to_html {
617          } elsif (/^(\s+.*)$/) {          } elsif (/^(\s+.*)$/) {
618              &back_push('pre', 1, \@saved, \@result);              &back_push('pre', 1, \@saved, \@result);
619              #push(@result, &escape($1)); # Not &inline, but &escape              #push(@result, &escape($1)); # Not &inline, but &escape
620              push(@result, &inline($1)); # Not &inline, but &escape              push(@result, &inline($1));
621  #       } elsif (/^\,(.*)$/) {             # Walrus del (BF)  #       } elsif (/^\,(.*)$/) {             # Walrus del (BF)
622          } elsif (/^\,(.*?)[\x0D\x0A]*$/) { # Walrus add (BF)          } elsif (/^\,(.*?)[\x0D\x0A]*$/) { # Walrus add (BF)
623              &back_push('table', 1, \@saved, \@result, ' border="1"');              &back_push('table', 1, \@saved, \@result, ' border="1"');
# Line 634  sub text_to_html { Line 642  sub text_to_html {
642              push(@result, join('', '<tr>', @value, '</tr>'));              push(@result, join('', '<tr>', @value, '</tr>'));
643              # XXXXX              # XXXXX
644              #######              #######
645            } elsif (/^\[INS\[/) {
646                push(@result, "<ins>");
647            } elsif (/^\]INS\]/) {
648                push(@result, "</ins>");
649            } elsif (/^\[DEL\[/) {
650                push(@result, "<del>");
651            } elsif (/^\]DEL\]/) {
652                push(@result, "</del>");
653            } elsif (/^\[PRE\[/) {
654                push(@result, "<pre>");
655            } elsif (/^\]PRE\]/) {
656                push(@result, "</pre>");
657          } else {          } else {
658              push(@result, &inline($_));              push(@result, &inline($_));
659          }          }
# Line 746  sub make_link { Line 766  sub make_link {
766          } elsif ($database{$chunk}) {          } elsif ($database{$chunk}) {
767              my $subject = &escape(&get_subjectline($chunk, delimiter => ''));              my $subject = &escape(&get_subjectline($chunk, delimiter => ''));
768  #           return qq(<a title="$subject" href="$url_cgi?$cookedchunk">$chunk</a>);  # Walrus del (3)  #           return qq(<a title="$subject" href="$url_cgi?$cookedchunk">$chunk</a>);  # Walrus del (3)
769              return qq(<a title="$subject" href="$url_cgi?$cookedchunk">@{[&escape($name)]}</a>);   # Walrus add (3)              return qq(<a title="$subject" href="$url_cgi?$cookedchunk" class="wiki">@{[&escape($name)]}</a>);   # Walrus add (3)
770          } elsif ($page_command{$chunk}) {          } elsif ($page_command{$chunk}) {
771  #           return qq(<a title="$chunk" href="$url_cgi?$cookedchunk">$chunk</a>);    # Walrus del (3)  #           return qq(<a title="$chunk" href="$url_cgi?$cookedchunk">$chunk</a>);    # Walrus del (3)
772              return qq(<a title="$chunk" href="$url_cgi?$cookedchunk" class="wiki">@{[&escape($name)]}</a>);     # Walrus add (3)              return qq(<a title="$chunk" href="$url_cgi?$cookedchunk" class="wiki">@{[&escape($name)]}</a>);     # Walrus add (3)
# Line 1245  sub embedded_to_html { Line 1265  sub embedded_to_html {
1265      <input type="hidden" name="comment_index" value="@{[$_O_COMMENT_INDEX++]}">      <input type="hidden" name="comment_index" value="@{[$_O_COMMENT_INDEX++]}">
1266      $embed_comment_Name_Prompt      $embed_comment_Name_Prompt
1267      <input type="text" name="myname" value="" size="10">      <input type="text" name="myname" value="" size="10">
1268      <input type="text" name="mymsg" value="" size="40">      <input type="text" name="mymsg" value="" size="60">
1269      <input type="submit" value="$resource{commentbutton}">      <input type="submit" value="$resource{commentbutton}">
1270  </form>  </form>
1271  EOD  EOD

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.26

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24