@idsoftsource/initial-process 2.2.5 → 2.2.6

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.
@@ -1213,15 +1213,19 @@ class TermsConditionsComponent {
1213
1213
  }));
1214
1214
  }
1215
1215
  /**
1216
- * Replaces {{PrivacyAndTerms?.fieldName}} and {{fieldName}} tokens,
1217
- * then converts literal \n sequences to <br> for HTML rendering.
1216
+ * 1. Unescape backslash-escaped quotes left over from JSON string storage (\" → ")
1217
+ * 2. Replace {{PrivacyAndTerms?.field}} and {{field}} tokens with live values
1218
+ * 3. Convert literal \n sequences to <br> for HTML line breaks
1218
1219
  */
1219
1220
  interpolate(template) {
1220
1221
  const vars = (this.PrivacyAndTerms ?? {});
1221
1222
  return template
1223
+ .replace(/\\"/g, '"')
1224
+ .replace(/\\'/g, "'")
1222
1225
  .replace(/\{\{PrivacyAndTerms\?\.(\w+)\}\}/g, (_, key) => vars[key] ?? '')
1223
1226
  .replace(/\{\{(\w+)\}\}/g, (_, key) => vars[key] ?? '')
1224
- .replace(/\\n/g, '<br>');
1227
+ .replace(/\\n/g, '<br>')
1228
+ .replace(/(<br\s*\/?>\s*){2,}/gi, '<br>');
1225
1229
  }
1226
1230
  isFilteredBrand() {
1227
1231
  return ['ID Claims', 'Mold Depot', 'Termite Depot'].includes(this.branding?.displayName);