Skip to content
Snippets Groups Projects
Commit b8ec4e54 authored by Alex ORLUC's avatar Alex ORLUC
Browse files

FEAT #13271 TIME 0:05 fix highlight

parent df2bc6c3
No related branches found
No related tags found
No related merge requests found
...@@ -12,7 +12,8 @@ export class HighlightPipe { ...@@ -12,7 +12,8 @@ export class HighlightPipe {
transform(text: string, args: string = '') { transform(text: string, args: string = '') {
let formatedText = ''; let formatedText = '';
if (typeof text === 'string') {
if (typeof text === 'string' && typeof args === 'string') {
const index = this.latinisePipe.transform(text.toLowerCase()).indexOf(this.latinisePipe.transform(args.toLowerCase())); const index = this.latinisePipe.transform(text.toLowerCase()).indexOf(this.latinisePipe.transform(args.toLowerCase()));
if (index >= 0) { if (index >= 0) {
formatedText = text.substring(0, index) + '<span class=\'highlightResult\'>' + text.substring(index, index + args.length) + '</span>' + text.substring(index + args.length); formatedText = text.substring(0, index) + '<span class=\'highlightResult\'>' + text.substring(index, index + args.length) + '</span>' + text.substring(index + args.length);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment