fix(UI): remove search highlight markup from merge profile names

https://github.com/safing/portmaster/issues/1490
This commit is contained in:
Alexandr Stelnykovych
2025-06-27 12:45:58 +03:00
parent 0c2dfbc489
commit d5c1a5c3f6

View File

@@ -134,11 +134,22 @@ export class AppOverviewComponent implements OnInit, OnDestroy {
});
}
stripHtmlTags(text: string): string {
if (!text) return '';
// Only strip if we have proper HTML tags (opening and closing with same tag name)
return text.replace(/<([a-zA-Z][a-zA-Z0-9]*)[^>]*>([^<]*)<\/\1>/g, '$2');
}
openMergeDialog() {
this.dialog.create(MergeProfileDialogComponent, {
autoclose: true,
backdrop: 'light',
data: this.profiles.filter((p) => p.selected),
data: this.profiles.filter((p) => p.selected)
.map((p) => ({
...p,
// Strip HTML tags from Name if it exists (e.g., highlighted search results)
...(p.Name ? { Name: this.stripHtmlTags(p.Name) } : {})
})),
});
this.selectMode = false;