From f8b1a8421bb9ab8ebd0b43b20c1d60a35271a18a Mon Sep 17 00:00:00 2001 From: Philippe <83185129+phil3838@users.noreply.github.com> Date: Tue, 4 Feb 2025 15:13:29 -0500 Subject: [PATCH] undo gift parser replacing --- .../DownloadQuizModal/DownloadQuizModal.tsx | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/client/src/components/DownloadQuizModal/DownloadQuizModal.tsx b/client/src/components/DownloadQuizModal/DownloadQuizModal.tsx index fc1084f..b676304 100644 --- a/client/src/components/DownloadQuizModal/DownloadQuizModal.tsx +++ b/client/src/components/DownloadQuizModal/DownloadQuizModal.tsx @@ -69,17 +69,9 @@ const DownloadQuizModal: React.FC = ({ quiz }) => { doc.setFontSize(16); selectedQuiz.content.forEach((question, index) => { - let formattedQuestion = question.trim(); - - - if (!withAnswers) { - formattedQuestion = formattedQuestion.replace(/::.*?::/g, '') - .replace(/\/\/.*$/gm, '') - .replace(/#[^\n]*/g, '') - .replace(/=/g, '') - .replace(/~/g, '') - .replace(/\{(.*?)\}/g, '{$1}'); - } + const formattedQuestion = withAnswers + ? question + : question.replace(/\{[^}]+\}/g, ''); const wrappedText = doc.splitTextToSize(`${index + 1}. ${formattedQuestion}`, 180);