Skip to content

Commit f875ff9

Browse files
HTML-decode tag names in getCleanedTagName for consistent display
Add Str.htmlDecode to getCleanedTagName so all tag display surfaces (picker, workspace list, edit screens, search filters, group headers, modified-expense messages, sidebar previews) render decoded entities like R&D instead of raw R&amp;D. Mirrors how getDecodedCategoryName handles categories in CategoryUtils. Co-authored-by: Abdelrahman Khattab <abzokhattab@users.noreply.github.com>
1 parent 0f104f2 commit f875ff9

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/libs/PolicyUtils.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -857,10 +857,11 @@ function getTagNamesFromTagsLists(policyTagLists: PolicyTagLists): string[] {
857857
}
858858

859859
/**
860-
* Cleans up escaping of colons (used to create multi-level tags, e.g. "Parent: Child") in the tag name we receive from the backend
860+
* Cleans up escaping of colons (used to create multi-level tags, e.g. "Parent: Child") in the tag name we receive from the backend,
861+
* and HTML-decodes the result so tags stored with encoded entities (e.g. `R&amp;D`) render as `R&D`.
861862
*/
862863
function getCleanedTagName(tag: string) {
863-
return tag?.replaceAll('\\:', CONST.COLON);
864+
return Str.htmlDecode(tag?.replaceAll('\\:', CONST.COLON) ?? '');
864865
}
865866

866867
/**

0 commit comments

Comments
 (0)