Commit 22c8d55d authored by Thibault Ehrhart's avatar Thibault Ehrhart

Fix html tags in Highlight pipe

parent 5befc78f
...@@ -12,9 +12,9 @@ export class HighlightPipe implements PipeTransform { ...@@ -12,9 +12,9 @@ export class HighlightPipe implements PipeTransform {
return t.length > 0; return t.length > 0;
}).join('|'); }).join('|');
const regex = new RegExp(pattern, 'gi'); const regex = new RegExp(pattern, 'gi');
return text.replace(regex, (match) => `<span class="search-highlight">${match}</span>`); text = text.replace(regex, (match) => `<span class="search-highlight">${match}</span>`);
} else { return this.sanitizer.bypassSecurityTrustHtml(text);
return 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