From bd04a0a07e12d380fbece0e51293c96d531388c7 Mon Sep 17 00:00:00 2001 From: "C. Fuhrman" Date: Sat, 14 Sep 2024 11:27:17 -0400 Subject: [PATCH 1/2] =?UTF-8?q?Utilisation=20de=20>=20dans=20mathjax=20ne?= =?UTF-8?q?=20fonctionne=20pas=20Fixes=20#84=20Affichage=20des=20matrice?= =?UTF-8?q?=20probl=C3=A9matique=20:=20ajout=20de=20'&'=20entre=20les=20?= =?UTF-8?q?=C3=A9l=C3=A9ments.=20#71?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/GiftTemplate/templates/TextType.ts | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/client/src/components/GiftTemplate/templates/TextType.ts b/client/src/components/GiftTemplate/templates/TextType.ts index b250637..5b206ed 100644 --- a/client/src/components/GiftTemplate/templates/TextType.ts +++ b/client/src/components/GiftTemplate/templates/TextType.ts @@ -16,17 +16,8 @@ function formatLatex(text: string): string { ); } -function escapeHTML(text: string) { - return text - .replace(/&/g, '&') - .replace(//g, '>') - .replace(/"/g, '"') - .replace(/'/g, '''); -} - export default function TextType({ text }: TextTypeOptions): string { - const formatText = formatLatex(escapeHTML(text.text.trim())); + const formatText = formatLatex(text.text.trim()); switch (text.format) { case 'moodle': From e14d516fc8b23ed054bbc44c9f2df4ecbcfbec29 Mon Sep 17 00:00:00 2001 From: "C. Fuhrman" Date: Sat, 14 Sep 2024 11:31:06 -0400 Subject: [PATCH 2/2] fixes #71 --- client/src/components/GiftTemplate/templates/TextType.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/components/GiftTemplate/templates/TextType.ts b/client/src/components/GiftTemplate/templates/TextType.ts index 5b206ed..a95a124 100644 --- a/client/src/components/GiftTemplate/templates/TextType.ts +++ b/client/src/components/GiftTemplate/templates/TextType.ts @@ -17,7 +17,7 @@ function formatLatex(text: string): string { } export default function TextType({ text }: TextTypeOptions): string { - const formatText = formatLatex(text.text.trim()); + const formatText = formatLatex(text.text.trim()); // latex needs pure "&", ">", etc. Must not be escaped switch (text.format) { case 'moodle':