8000 confusables: Fix internal skeleton · unicode-rs/unicode-security@78707a7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 78707a7

Browse files
committed
confusables: Fix internal skeleton
1 parent ec837b2 commit 78707a7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/confusable_detection.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ fn char_prototype(c: char) -> OnceOrMore<char, StaticSliceIterCloned> {
3434

3535
/// Calculate skeleton for string, as defined by UTS 39
3636
pub fn skeleton(s: &str) -> impl Iterator<Item = char> + '_ {
37+
use crate::tables::default_ignorable_code_point::default_ignorable_code_point;
3738
use unicode_normalization::UnicodeNormalization;
38-
s.chars().nfd().flat_map(char_prototype).nfd()
39+
40+
s.chars()
41+
.nfd()
42+
.filter(|c| !default_ignorable_code_point(*c))
43+
.flat_map(char_prototype)
44+
.nfd()
3945
}

0 commit comments

Comments
 (0)
0