Fix html tags in Highlight pipe

parent 5befc78f
......@@ -12,9 +12,9 @@ export class HighlightPipe implements PipeTransform {
return t.length > 0;
}).join('|');
const regex = new RegExp(pattern, 'gi');
return text.replace(regex, (match) => `<span class="search-highlight">${match}</span>`);
} else {
return text;
text = text.replace(regex, (match) => `<span class="search-highlight">${match}</span>`);
return this.sanitizer.bypassSecurityTrustHtml(text);
}
return text;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment