@@ -6,6 +6,11 @@ document.addEventListener('DOMContentLoaded', function() {
6
6
7
7
let activeCategory = 'all' ;
8
8
9
+ // Normalize text by removing diacritics for search
10
+ function normalizeText ( text ) {
11
+ return text . normalize ( 'NFD' ) . replace ( / [ \u0300 - \u036f ] / g, '' ) . toLowerCase ( ) ;
12
+ }
13
+
9
14
// Highlight matching text
10
15
function highlightText ( element , searchTerm ) {
11
16
if ( ! searchTerm ) return ;
@@ -109,6 +114,7 @@ document.addEventListener('DOMContentLoaded', function() {
109
114
row . dataset . personName = fullName . toLowerCase ( ) ;
110
115
row . dataset . personCategory = category ;
111
116
row . dataset . searchData = `${ uvaId } ${ fullName } ${ position } ${ specialty } ${ office } ${ email } ${ phone } ${ officeHours } ${ researchTags } ` . toLowerCase ( ) ;
117
+ row . dataset . searchDataNormalized = normalizeText ( `${ uvaId } ${ fullName } ${ position } ${ specialty } ${ office } ${ email } ${ phone } ${ officeHours } ${ researchTags } ` ) ;
112
118
} ) ;
113
119
} ) ;
114
120
}
@@ -139,14 +145,16 @@ document.addEventListener('DOMContentLoaded', function() {
139
145
matchesSearch = true ;
140
146
} else {
141
147
const searchData = row . dataset . searchData ;
148
+ const searchDataNormalized = row . dataset . searchDataNormalized ;
142
149
143
150
// Smart case matching
144
151
if ( originalSearchTerm !== originalSearchTerm . toLowerCase ( ) ) {
145
152
// Contains uppercase letters - case sensitive search
146
153
matchesSearch = row . textContent . includes ( originalSearchTerm ) ;
147
154
} else {
148
- // All lowercase - case insensitive search
149
- matchesSearch = searchData . includes ( searchTerm ) ;
155
+ // All lowercase - case insensitive search with diacritic normalization
156
+ const normalizedSearchTerm = normalizeText ( searchTerm ) ;
157
+ matchesSearch = searchData . includes ( searchTerm ) || searchDataNormalized . includes ( normalizedSearchTerm ) ;
150
158
}
151
159
}
152
160
0 commit comments