import { Pipe, PipeTransform } from "@angular/core";

@Pipe({
  name: "highlightWord",
})
export class HighlightWordPipe implements PipeTransform {
  transform(value: string, word: string): string {
    value
      /*.replace(/&/g, "&amp;")
      .replace(/>/g, "&gt;")
      .replace(/</g, "&lt;")
      .replace(/"/g, "&quot;")*/
      .replace(new RegExp(word, "g"), "<mark>" + word + "</mark>");
    return value;
  }
}
