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

@Pipe({
  name: 'parseTaskBodyHtml',
})
export class ParseTaskBodyHtml implements PipeTransform {
  transform(textAsInnerHTML: string): string {
    function removeHtmlTags(string): string {
      return string
        .replace(/<[^>]*>/g, ' ')
        .replace(/\s{2,}/g, ' ')
        .trim();
    }

    return removeHtmlTags(textAsInnerHTML);
  }
}
