summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
5eb5ea3)
Marking up digraph properties makes no sense if digraphs are not shown.
Fall back to exposing latin1 and bmp characters instead.
use Data::Dump 'pp';
use PLP::Functions 'EscapeHTML';
use Data::Dump 'pp';
use PLP::Functions 'EscapeHTML';
our $diinfo = do 'digraphs.inc.pl';
our %di = map { $diinfo->{$_}->[0] => $_ } grep { ref $diinfo->{$_} }
our $diinfo = do 'digraphs.inc.pl';
our %di = map { $diinfo->{$_}->[0] => $_ } grep { ref $diinfo->{$_} }
($cell, $title, my $class, $mnem) = $self->glyphs_html($input);
($cell, $title, my $class, $mnem) = $self->glyphs_html($input);
- if (defined $mnem) {
- push @class, 'di-d'; # digraph
- push @class, 'di-prop' if $class =~ /\bXz\b/; # unofficial
+ if ($self->{digraph}) {
+ if (defined $mnem) {
+ push @class, 'di-d'; # digraph
+ push @class, 'di-prop' if $class =~ /\bXz\b/; # unofficial
+ }
+ }
+ else {
+ my $codepoint = ord(substr $input, 0, 1);
+ if ($codepoint <= 0xFF) {
+ push @class, 'di-d'; # latin1
+ }
+ elsif ($codepoint <= 0xD7FF) {
+ push @class, 'di-prop'; # bmp
+ }
}
if ($input =~ /[ -~]/) {
}
if ($input =~ /[ -~]/) {
defined $title ? qq{ title="$title"} : '',
@class ? sprintf(' class="%s"', join ' ', @class) : '',
$html || '',
defined $title ? qq{ title="$title"} : '',
@class ? sprintf(' class="%s"', join ' ', @class) : '',
$html || '',
- $cell eq '' ? ' ' : $cell,
- $self->{digraph} && defined $mnem && length $mnem
+ $cell eq '' ? (' ', '') : ($cell,
+ $self->{digraph} && defined $mnem && length $mnem
? sprintf(' <small class="digraph">%s</small>', EscapeHTML($mnem))
: $self->{unicode} + $cell =~ /^[^a-zA-Z]$/ > 0
? sprintf(' <small class="%s">%04X</small>', 'value', ord $cell)
? sprintf(' <small class="digraph">%s</small>', EscapeHTML($mnem))
: $self->{unicode} + $cell =~ /^[^a-zA-Z]$/ > 0
? sprintf(' <small class="%s">%04X</small>', 'value', ord $cell)
use Shiar_Sheet::FormatChar;
my $glyphs = Shiar_Sheet::FormatChar->new;
use Shiar_Sheet::FormatChar;
my $glyphs = Shiar_Sheet::FormatChar->new;
+if (exists $get{di}) {
+ $glyphs->{digraph} = defined $get{di} ? ! !$get{di} : 1;
+ $glyphs->{unicode} = 1;
+}
+ $glyphs->{unicode} = -1;
<div class="legend">
<table class="glyphs"><tr>
<td class="X di-a">ascii
<div class="legend">
<table class="glyphs"><tr>
<td class="X di-a">ascii
- <td class="X di-d">digraph
- <td class="X di-prop">proposed
+ <td class="X di-d"><:= $glyphs->{digraph} ? 'digraph' : 'latin1' :>
+ <td class="X di-prop"><:= $glyphs->{digraph} ? 'proposed' : 'BMP' :>
<td class="X di-b">other unicode
<td class="X di-rare">discouraged
</table>
<td class="X di-b">other unicode
<td class="X di-rare">discouraged
</table>