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

@Pipe({
  name: "stripHtml",
})
export class StripHtmlPipe implements PipeTransform {
  transform(value: any, ...args: any[]): any {
    // 过滤html标签和实体
    if(value){
      return value.replace(/<[^>]*>|&[a-z0-9]+;/g, '');
    }else{
      return '';
    }
  }
}
