File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -266,6 +266,8 @@ export class TypeaheadContainerComponent implements OnDestroy {
266266 // Replaces the capture string with the same string inside of a "strong" tag
267267 if ( typeof query === 'object' ) {
268268 const queryLen : number = query . length ;
269+ const PLACEHOLDER_CHAR = '\u2063' ; // Invisible Separator
270+ const STRONG_PLACEHOLDER_COUNT = 17 ; // 8 + 9: strong tag length (opening and closing)
269271 for ( let i = 0 ; i < queryLen ; i += 1 ) {
270272 // query[i] is already latinized and lower case
271273 startIdx = itemStrHelper . indexOf ( query [ i ] ) ;
@@ -275,7 +277,8 @@ export class TypeaheadContainerComponent implements OnDestroy {
275277 `${ itemStr . substring ( 0 , startIdx ) } <strong>${ itemStr . substring ( startIdx , startIdx + tokenLen ) } </strong>` +
276278 `${ itemStr . substring ( startIdx + tokenLen ) } ` ;
277279 itemStrHelper =
278- `${ itemStrHelper . substring ( 0 , startIdx ) } ????????${ '??' . repeat ( tokenLen ) } ??????????` +
280+ `${ itemStrHelper . substring ( 0 , startIdx ) } ` +
281+ `${ PLACEHOLDER_CHAR . repeat ( STRONG_PLACEHOLDER_COUNT + tokenLen ) } ` +
279282 `${ itemStrHelper . substring ( startIdx + tokenLen ) } ` ;
280283 }
281284 }
You can’t perform that action at this time.
0 commit comments