854d13ddf8b3d42bc5a086ef45f216b536fc789c
Perl/\347\222\260\345\242\203\345\244\211\346\225\260.md
... | ... | @@ -35,12 +35,24 @@ my $cginame = 'PrintEnv'; |
35 | 35 | |
36 | 36 | printHeader(); |
37 | 37 | |
38 | -print $q->start_table( { '-summary' => 'ENV', '-border' => 1, '-style' => 'width: 100%;' } ); |
|
38 | +print $q->start_table( |
|
39 | + { '-summary' => 'ENV', |
|
40 | + '-border' => 1, |
|
41 | + '-style' => 'width: 100%; overflow-wrap: break-word;', # table-layout: fixed; |
|
42 | + } |
|
43 | +); |
|
39 | 44 | print $q->Tr( $q->th( [ 'Key', 'Value' ] ) ); |
40 | -foreach ( sort( keys(%ENV) ) ) { |
|
41 | - if (/^(CONTENT_|GEOIP_|HTTPS|HTTP_|QUERY_|REMOTE_|REQUEST_|SERVER_(ADDR|NAME|PORT|PROTOCOL))/i) |
|
45 | +foreach my $key ( sort( keys(%ENV) ) ) { |
|
46 | + if ( $key |
|
47 | + =~ /^(CONTENT_|GEOIP_|HTTPS|HTTP_|QUERY_|REMOTE_|REQUEST_|SERVER_(ADDR|NAME|PORT|PROTOCOL))/i |
|
48 | + ) |
|
42 | 49 | { |
43 | - print $q->Tr( $q->td( [ $_, $ENV{$_} ] ) ); |
|
50 | + my $value = $ENV{$key}; |
|
51 | + $key =~ s/(_)/​\1/g; # insert 'zero width space' for line break |
|
52 | + $value =~ s/(;|\/)/\1<wbr>/g; |
|
53 | + $value =~ s/(\?|&|#)/<wbr>\1/g; |
|
54 | + $value =~ s/<wbr>/​/g; |
|
55 | + print $q->Tr( $q->td( [ $key, $value ] ) ); |
|
44 | 56 | } |
45 | 57 | } |
46 | 58 | print $q->end_table(); |