/[suikacvs]/test/html-webhacc/cc.cgi
Suika

Diff of /test/html-webhacc/cc.cgi

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

revision 1.9 by wakaba, Sun Jul 15 16:39:10 2007 UTC revision 1.10 by wakaba, Mon Jul 16 08:38:48 2007 UTC
# Line 80  if (defined $input->{s}) { Line 80  if (defined $input->{s}) {
80    if ($input->{media_type} eq 'text/html') {    if ($input->{media_type} eq 'text/html') {
81      require Encode;      require Encode;
82      require Whatpm::HTML;      require Whatpm::HTML;
83    
84        $input->{charset} ||= 'ISO-8859-1'; ## TODO: for now.
85            
86      my $t = Encode::decode ($input->{charset}, $input->{s});      my $t = Encode::decode ($input->{charset}, $input->{s});
87    
# Line 87  if (defined $input->{s}) { Line 89  if (defined $input->{s}) {
89  <div id="parse-errors" class="section">  <div id="parse-errors" class="section">
90  <h2>Parse Errors</h2>  <h2>Parse Errors</h2>
91    
92  <dl>  <dl>];
 ];  
93    push @nav, ['#parse-errors' => 'Parse Error'];    push @nav, ['#parse-errors' => 'Parse Error'];
94    
95    my $onerror = sub {    my $onerror = sub {
# Line 115  if (defined $input->{s}) { Line 116  if (defined $input->{s}) {
116      Whatpm::HTML->parse_string ($t => $doc, $onerror);      Whatpm::HTML->parse_string ($t => $doc, $onerror);
117    }    }
118    
119    print STDOUT qq[    print STDOUT qq[</dl>
 </dl>  
120  </div>  </div>
121  ];  ];
122    
# Line 493  sub get_text ($) { Line 493  sub get_text ($) {
493    {    {
494      if (defined $Msg->{$type}) {      if (defined $Msg->{$type}) {
495        my $msg = $Msg->{$type}->[1];        my $msg = $Msg->{$type}->[1];
496        $msg =~ s/\$([0-9]+)/defined $arg[$1] ? htescape ($arg[$1]) : '(undef)'/ge;        $msg =~ s{<var>\$([0-9]+)</var>}{
497            defined $arg[$1] ? htescape ($arg[$1]) : '(undef)';
498          }ge;
499        return ($Msg->{$type}->[0], $msg);        return ($Msg->{$type}->[0], $msg);
500      } elsif ($type =~ s/:([^:]*)$//) {      } elsif ($type =~ s/:([^:]*)$//) {
501        unshift @arg, $1;        unshift @arg, $1;

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24