Parent Directory
|
Revision Log
++ ChangeLog 27 Jul 2008 10:33:38 -0000 2008-07-27 Wakaba <wakaba@suika.fam.cx> * .htaccess: Files gone. * cc-interface.en.html, cc-todo.txt: Removed. * cc-about.en.html: New document. * cc.cgi: Insert document input section before anything. No check performed if no URL is specified and the input is empty. * error-description-source.xml (WebHACC:Heading): Link to cc-about in place of cc-interface. ++ html/WebHACC/Language/ChangeLog 27 Jul 2008 10:31:14 -0000 2008-07-27 Wakaba <wakaba@suika.fam.cx> * CSS.pm (generate_structure_dump_section): Role name was wrong. ++ html/WebHACC/ChangeLog 27 Jul 2008 10:30:52 -0000 2008-07-27 Wakaba <wakaba@suika.fam.cx> * Output.pm (new, input): |input| attribute should always have an input object, even though it might be an empty one. (add_source_to_parse_error_list): s/shift/shift ()/ to remove ambigiousness warning. (select): New method. (generate_input_section): New method.
| 1 | wakaba | 1.1 | package WebHACC::Output; |
| 2 | use strict; | ||
| 3 | wakaba | 1.3 | |
| 4 | wakaba | 1.1 | require IO::Handle; |
| 5 | wakaba | 1.3 | use Scalar::Util qw/refaddr/; |
| 6 | wakaba | 1.1 | |
| 7 | my $htescape = sub ($) { | ||
| 8 | my $s = $_[0]; | ||
| 9 | $s =~ s/&/&/g; | ||
| 10 | $s =~ s/</</g; | ||
| 11 | $s =~ s/>/>/g; | ||
| 12 | $s =~ s/"/"/g; | ||
| 13 | $s =~ s{([\x00-\x09\x0B-\x1F\x7F-\xA0\x{FEFF}\x{FFFC}-\x{FFFF}])}{ | ||
| 14 | sprintf '<var>U+%04X</var>', ord $1; | ||
| 15 | }ge; | ||
| 16 | return $s; | ||
| 17 | }; | ||
| 18 | |||
| 19 | sub new ($) { | ||
| 20 | wakaba | 1.9 | require WebHACC::Input; |
| 21 | return bless {nav => [], section_rank => 1, | ||
| 22 | input => WebHACC::Input->new}, shift; | ||
| 23 | wakaba | 1.1 | } # new |
| 24 | |||
| 25 | sub input ($;$) { | ||
| 26 | if (@_ > 1) { | ||
| 27 | if (defined $_[1]) { | ||
| 28 | $_[0]->{input} = $_[1]; | ||
| 29 | } else { | ||
| 30 | wakaba | 1.9 | $_[0]->{input} = WebHACC::Input->new; |
| 31 | wakaba | 1.1 | } |
| 32 | } | ||
| 33 | |||
| 34 | return $_[0]->{input}; | ||
| 35 | } # input | ||
| 36 | |||
| 37 | sub handle ($;$) { | ||
| 38 | if (@_ > 1) { | ||
| 39 | if (defined $_[1]) { | ||
| 40 | $_[0]->{handle} = $_[1]; | ||
| 41 | } else { | ||
| 42 | delete $_[0]->{handle}; | ||
| 43 | } | ||
| 44 | } | ||
| 45 | |||
| 46 | return $_[0]->{handle}; | ||
| 47 | } # handle | ||
| 48 | |||
| 49 | sub set_utf8 ($) { | ||
| 50 | binmode shift->{handle}, ':utf8'; | ||
| 51 | } # set_utf8 | ||
| 52 | |||
| 53 | sub set_flush ($) { | ||
| 54 |