digraphs: translate vim support levels to appropriate fg classes
[sheet.git] / digraphs.plp
index 6e0608c20cd41f9679b9e316f21fafe6d86067b6..05d9241f41cdef1c86dc6671d807c1cd9e170524 100644 (file)
@@ -83,7 +83,8 @@ for my $c1group (@chars) {
                        utf8::upgrade($glyph);  # prevent latin1 output
                        my $desc = $mnem . ($name && " ($name)");
                        my @class = ('X', grep {$_} $script);
-                       push @class, $cmp ? $support : "u-$support" if $support;
+                       push @class, $cmp ? $support :
+                               $di->{flagclass}->{$support} // "u-$support" if $support;
 
                        $glyph = EscapeHTML($glyph);
                        $glyph = "<span>$glyph</span>" if $script =~ /\bZs\b/;
@@ -122,7 +123,7 @@ print '<hr>' if exists $get{split};
        </table>
 <: } :>
        <table class="glyphs"><tr><:
-       printf qq(\n\t<td class="X %s">%s), (!$cmp && 'u-').$_, $di->{flag}->{$_}
+       printf qq(\n\t<td class="X %s">%s), $cmp ? $_ : $di->{flagclass}{$_} // "u-$_", $di->{flag}->{$_}
                for sort keys %{ $di->{flag} };
 :>
        </table>