Skip to content

Commit e243623

Browse files
committed
cleanup
1 parent ed16757 commit e243623

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

toUnicodeVariant.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ function toUnicodeVariant(str, variant, flags) {
131131
'x-above': { 'short': 'x-a', 'code': 0x036F },
132132
'cross-above': { 'short': 'ca', 'code': 0x033D },
133133
'plus-below': { 'short': 'pb', 'code': 0x031F },
134-
135134
//diacritics supporting special chars
136135
'diaeresis': { 'code': 0x0308 },
137136
'caron': { 'code': 0x030C },
@@ -234,8 +233,10 @@ function toUnicodeVariant(str, variant, flags) {
234233
//'s̈': { 'char': 's', 'combine': String.fromCodePoint(diacritics.diaeresis.code) },
235234
}
236235

237-
for (const char of 'ÄÂÁÅĂǞĀȦȂĈĆĊÈĒĔËĚĞǦĢḰḲŅÕÖÜ') {
238-
special_chars[char] = { 'char': char.normalize('NFD').replace(/[\u0300-\u036f]/g, ''), 'combine': false }
236+
//reset special chars, capital letters
237+
//in the future, some capital speciel chars can be mimicked as well
238+
for (const char of Object.keys(special_chars)) {
239+
special_chars[char.toUpperCase()] = { 'char': char, 'combine': false }
239240
}
240241

241242
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'

0 commit comments

Comments
 (0)