tnx-shared 5.3.380 → 5.3.381

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4133,6 +4133,17 @@ class CommonService {
4133
4133
  const temp = s.normalize('NFD');
4134
4134
  return temp.replace(regex, '').replace('\u0111', 'd').replace('\u0110', 'D');
4135
4135
  }
4136
+ extractInnerText(htmlString) {
4137
+ if (!htmlString)
4138
+ return '';
4139
+ const withoutComments = htmlString.replace(/<!--[\s\S]*?-->/g, '');
4140
+ // Tạo một DOM element từ chuỗi HTML đã loại bỏ comment
4141
+ const parser = new DOMParser();
4142
+ let doc = parser.parseFromString(withoutComments, 'text/html');
4143
+ const result = doc.body.innerText.trim();
4144
+ doc = null; // Dọn dẹp tham chiếu (không cần thiết nếu scope kết thúc)
4145
+ return result;
4146
+ }
4136
4147
  }
4137
4148
  CommonService.ɵprov = i0.ɵɵdefineInjectable({ factory: function CommonService_Factory() { return new CommonService(i0.ɵɵinject(ModuleConfigService)); }, token: CommonService, providedIn: "root" });
4138
4149
  CommonService.decorators = [