{ head("Lintian Reports by Maintainer") }
  <h1>Maintainers</h1>

  <p>
    Maintainers are listed sorted case-insensitively by package maintainer
    string.  This is an unsophisticated sort that does not take into
    account any national collating sequence, only Unicode strings, so
    maintainers whose names start with non-ASCII characters will sort at
    the end of this page.
  </p>

  <p>
    Jump to: { join (' ', (map { qq(<a href="#$_">$_</a>) } 'A'..'Z', 'Other')) }
{
    # !!NB!! We are deliberately leaving out the closing "</p>" here.
    # It will be added by the loop below, which can (due to this)
    # unconditionally emit a "</p>" at the start of each new letter.

    # Put headings before each new initial letter and add anchors, except
    # for non-ASCII initial characters.  For those, since we can't be
    # assured we'll get combining characters right, just accumulate them
    # under a heading of Other.
    my $letter = '';
    my @order = sort {
       my $la = lc($a);
       my $lb = lc($b);
       # Ensure non-ASCII characters get push to the back
       if ($la lt 'a' and $lb ge 'a') {
          1;
       } elsif ($la ge 'a' and $lb lt 'a') {
          -1;
       } else {
          $la cmp $lb;
       }
    } keys(%maintainers);
    for my $key (@order) {
        my $maint_data = $maintainers{$key};
        my $url = $maint_data->{url};
        my $maintainer = $maint_data->{name};
        my $first = uc substr($key, 0, 1);
        if ($first lt 'A' || $first gt 'Z') {
            $first = 'Other';
        }
        if ($first ne $letter) {
            $letter = $first;
            if ($letter eq 'Other') {
                $OUT .= qq(  </p>\n\n  <h2 id="Other">Other</h2>\n\n  <p>\n);
            } else {
                $OUT .= qq(  </p>\n\n  <h2 id="$letter"><a id="$letter">)
                    . $letter . "</a></h2>\n\n  <p>\n";
            }
        }
        $OUT .= qq(    <a href="${path_prefix}maintainer/$url">$maintainer</a>)
            . qq{ (<a href="${path_prefix}full/$url">full report</a>)<br />\n};
    }
}  </p>
{ foot() }
