add meta data (language, description, keywords)
[sheet.git] / cc.plp
diff --git a/cc.plp b/cc.plp
index 847324176763bdaa7e675c47c1fe363f48f4e688..e2d4f991ff4263f27ad533d562450858ebd00f62 100644 (file)
--- a/cc.plp
+++ b/cc.plp
@@ -3,11 +3,13 @@
 
 :><!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>
+<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') :>
 </head>
 
 <:
 my $cc = do 'cc.inc.pl';
 
-sub quote {
-       local $_ = shift;
-       s/"/&quot;/g;
-       s/</&lt;/g;
-       s/>/&gt;/g;
-       return $_;
-}
-
 {
        printf '<table class="mcmap">';
        print '<col><colgroup span="26">';
@@ -62,12 +56,12 @@ sub quote {
                                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";
        }