-<:
-use utf8;
-use strict;
-use warnings;
-use open IO => ':utf8';
-
-our $VERSION = 'v1.0';
-
-$header{content_type} = 'text/html; charset=utf-8';
+<(common.inc.plp)><:
+ our $VERSION = 'v1.0';
:><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
-<html>
+<html lang="en">
<head>
<meta http-equiv="content-type" content="<:= $header{content_type} :>">
<title>country code cheat sheet</title>
-<link rel="stylesheet" type="text/css" media="all" href="/base.css"><:
- my %styles = map {$_ => $_} qw(dark mono red);
- our $style = exists $get{style} && $styles{$get{style}} || 'light';
- printf(qq{\n<link rel="%s" type="text/css" media="all" href="%s" title="%s">},
- $_ eq $style ? 'stylesheet' : 'alternate stylesheet', "/$_.css", $_
- ) for keys %styles;
-:>
+<meta name="description" content="Table of ISO-3166-2 country codes with the names of reserved territories.">
+<meta name="keywords" content="country, code, cc, tld, territory, land, table">
+<:= stylesheet(qw'light dark mono red') :>
+<link rel="icon" type="image/png" href="/clip.png">
</head>
<body>
<:
my $cc = do 'cc.inc.pl';
-sub quote {
- local $_ = shift;
- s/"/"/g;
- s/</</g;
- s/>/>/g;
- return $_;
-}
-
{
printf '<table class="mcmap">';
print '<col><colgroup span="26">';
s/North(?:ern)? /N-/g;
s/New /n./g;
s/(\S)(\S+)-/$1-/g; # strip most chars preceding dash
- s/(\S{4}[b-df-hj-np-tv-xz])(\w{2,})/$1./g; # abbreviate (at consonant)
- $_ = quote($_);
+ s/(\S{4}[b-df-hj-np-tv-xz])((?<!Austr)(?!land)\w{2,})/$1./g; # abbreviate (at consonant)
+ $_ = EscapeHTML($_);
}
$name =~ s/([^,]*), (.*)/$2 $1/;
printf "\n".'<td class="%s" title="%s">%s',
- $_ ? 'X '.$class : '', quote("$code: $name"), $_;
+ $_ ? 'X '.$class : '', EscapeHTML("$code: $name"), $_;
}
print "\n";
}