File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -14,13 +14,13 @@ module.exports = str => {
14
14
for ( let i = 0 ; i < str . length ; i ++ ) {
15
15
const code = str . codePointAt ( i ) ;
16
16
17
- // Ignore control characters
18
- if ( code <= 0x1F || ( code >= 0x7F && code <= 0x9F ) ) {
17
+ // Ignore control characters & combining characters
18
+ if ( code <= 0x1F || ( code >= 0x7F && code <= 0x9F ) || ( code >= 0x300 && code <= 0x36F ) ) {
19
19
continue ;
20
20
}
21
21
22
22
// Surrogates
23
- if ( code >= 0x10000 ) {
23
+ if ( code > 0xFFFF ) {
24
24
i ++ ;
25
25
}
26
26
Original file line number Diff line number Diff line change @@ -21,6 +21,6 @@ test('ignores control characters', t => {
21
21
t . is ( m ( '\u001B' ) , 0 ) ;
22
22
} ) ;
23
23
24
- test . failing ( 'handles combining characters' , t => {
24
+ test ( 'handles combining characters' , t => {
25
25
t . is ( m ( 'x\u0300' ) , 1 ) ;
26
26
} ) ;
You can’t perform that action at this time.
0 commit comments