keyboard/altgr: ignore partial decomposition as accented flag
authorMischa POSLAWSKY <perl@shiar.org>
Tue, 5 Mar 2024 17:14:27 +0000 (18:14 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Wed, 6 Mar 2024 00:38:51 +0000 (01:38 +0100)
Prevent fractions such as ¾ (3/4) from matching either 3 or 4
in eurkey and msx-graph.  No changes otherwise.

Shiar_Sheet/KeyboardChars.pm

index 0c5b5e50ff91c35593d64e22c1c757daea6df722..d0e84c8e082799c31b45428b979b20cf36abe895 100644 (file)
@@ -55,7 +55,7 @@ sub kbmodes ($modes) {
                        my $class = (
                                  !defined $v || $c eq $v ? 'no' # identical
                                : $v =~ /\A\p{Mn}+\z/ ? 'g9' # combining accent
-                               : NFKD($v) =~ /\Q$c/ ? 'g2' # decomposed equivalent
+                               : NFKD($v) =~ /\A\Q$c\E\p{Mn}*\z/ ? 'g2' # decomposed equivalent
                                : unidecode($v) =~ /\Q$c\E+/i ? 'g4' # transliterated
                                : $v =~ /\A[\p{Sk}\p{Lm}]+\z/ ? 'g8' # modifier symbol
                                : $v =~ /\A[\pM\pP]+\z/ ? 'g7' # mark