From f5b2ffa029d683f8f84714b3b8bc7682f21ad043 Mon Sep 17 00:00:00 2001 From: Donkie Date: Sun, 17 Dec 2023 20:46:03 +0100 Subject: [PATCH] Fixed show page titles double-escaping HTML entities Fixes #187 --- client/src/pages/filaments/show.tsx | 6 +++++- client/src/pages/spools/show.tsx | 6 +++++- client/src/pages/vendors/show.tsx | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/client/src/pages/filaments/show.tsx b/client/src/pages/filaments/show.tsx index 7536e07..d30513d 100644 --- a/client/src/pages/filaments/show.tsx +++ b/client/src/pages/filaments/show.tsx @@ -27,7 +27,11 @@ export const FilamentShow: React.FC = () => { if (item.vendor) { vendorPrefix = `${item.vendor.name} - `; } - return t("filament.titles.show_title", { id: item.id, name: vendorPrefix + item.name }); + return t("filament.titles.show_title", { + id: item.id, + name: vendorPrefix + item.name, + interpolation: { escapeValue: false }, + }); }; const gotoVendor = (): undefined => { diff --git a/client/src/pages/spools/show.tsx b/client/src/pages/spools/show.tsx index 68bca8b..2765310 100644 --- a/client/src/pages/spools/show.tsx +++ b/client/src/pages/spools/show.tsx @@ -45,7 +45,11 @@ export const SpoolShow: React.FC = () => { }; const formatTitle = (item: ISpool) => { - return t("spool.titles.show_title", { id: item.id, name: formatFilament(item.filament) }); + return t("spool.titles.show_title", { + id: item.id, + name: formatFilament(item.filament), + interpolation: { escapeValue: false }, + }); }; return ( diff --git a/client/src/pages/vendors/show.tsx b/client/src/pages/vendors/show.tsx index 87c7900..ac115b8 100644 --- a/client/src/pages/vendors/show.tsx +++ b/client/src/pages/vendors/show.tsx @@ -22,7 +22,7 @@ export const VendorShow: React.FC = () => { const record = data?.data; const formatTitle = (item: IVendor) => { - return t("vendor.titles.show_title", { id: item.id, name: item.name }); + return t("vendor.titles.show_title", { id: item.id, name: item.name, interpolation: { escapeValue: false } }); }; return (