package Shiar_Sheet::FormatChar;
+use 5.010;
use strict;
use warnings;
push @class, 'u-invalid';
$cell = '';
}
- else {
+ else {{
push @class, 'X';
if ($input =~ s/^-//) {
$input =~ s/^\\//; # escaped char
($cell, $title, my $class, $mnem, $entity) = $self->glyphs_html($input);
- if ($self->{style} = 'di') {
+ if ($self->{style} eq 'univer') {
+ state $agemap = do 'unicode-age.inc.pl' or die $!;
+ my $version = $agemap->{ord $input};
+ if (!$version) {
+ push @class, 'l1'; # no known unicode assignment
+ }
+ elsif ($version < 20) {
+ push @class, 'l5'; # first release 1993
+ }
+ elsif ($version < 31) {
+ push @class, 'l4'; # 20th century
+ }
+ elsif ($version < 50) {
+ push @class, 'l4'; # over 10 years ago
+ }
+ elsif ($version < 61) {
+ push @class, 'l3'; # before 2012
+ }
+ else {
+ push @class, 'l2'; # more recent
+ }
+ next;
+ }
+
+ if ($self->{style} eq 'di') {
if ($class =~ /\bu-di\b/) {
push @class, ('l3', 'u-di'); # standard digraph
}
push @class, ('l2', 'u-prop'); # unofficial
}
}
+ elsif ($self->{style} eq 'html') {
+ if (defined $entity) {
+ push @class, ('l3', 'u-html');
+ }
+ }
else {
my $codepoint = ord(substr $input, 0, 1);
if ($codepoint <= 0xFF) {
else {
push @class, 'l1'; # basic unicode
}
- }
+ }}
my $anno = '';
if ($cell ne '') {
if ($cell =~ s/^>//) {
# header cell text follows
$cell =~ s/_/ /g; # underscores may be used instead of whitespace (for qw//ability)
- $rows[-1] .= '<th>'.($cell || ' ');
+ my $class = $cell =~ s/^-// && ' class="ex"';
+ $rows[-1] .= "<th$class>".($cell || ' ');
}
next;
}