diff --git a/client/src/components/GIFTCheatSheet/GiftCheatSheet.tsx b/client/src/components/GIFTCheatSheet/GiftCheatSheet.tsx
index 179e454..4dc9f1e 100644
--- a/client/src/components/GIFTCheatSheet/GiftCheatSheet.tsx
+++ b/client/src/components/GIFTCheatSheet/GiftCheatSheet.tsx
@@ -137,14 +137,19 @@ const GiftCheatSheet: React.FC = () => {
-
8. LaTeX
+
8. LaTeX et Markdown
- Le format LaTeX est supporté dans cette application. Vous devez cependant penser
+ Les format LaTeX et markdown sont supportés dans cette application. Vous devez cependant penser
à 'échapper' les caractères spéciaux mentionnés plus haut.
Exemple d'équation:
- {'$$x\\= \\frac\\{y^2\\}\\{4\\}$$'}
+ {'$$x\\= \\frac\\{y^2\\}\\{4\\}$$'}
+ {'\n$x\\= \\frac\\{y^2\\}\\{4\\}$'}
+
+
Exemple de texte Markdown:
+
+ {'[markdown]Grâce à la balise markdown, Il est possible d\'insérer du texte *italique*, **gras**, du `code` et bien plus.'}
diff --git a/client/src/components/GiftTemplate/templates/TextType.ts b/client/src/components/GiftTemplate/templates/TextType.ts
index bf9a3a3..b250637 100644
--- a/client/src/components/GiftTemplate/templates/TextType.ts
+++ b/client/src/components/GiftTemplate/templates/TextType.ts
@@ -9,6 +9,7 @@ interface TextTypeOptions extends TemplateOptions {
function formatLatex(text: string): string {
return text
.replace(/\$\$(.*?)\$\$/g, (_, inner) => katex.renderToString(inner, { displayMode: true }))
+ .replace(/\$(.*?)\$/g, (_, inner) => katex.renderToString(inner, { displayMode: false }))
.replace(/\\\[(.*?)\\\]/g, (_, inner) => katex.renderToString(inner, { displayMode: true }))
.replace(/\\\((.*?)\\\)/g, (_, inner) =>
katex.renderToString(inner, { displayMode: false })
diff --git a/client/src/components/Questions/MultipleChoiceQuestion/MultipleChoiceQuestion.tsx b/client/src/components/Questions/MultipleChoiceQuestion/MultipleChoiceQuestion.tsx
index 54022a3..d3e7a82 100644
--- a/client/src/components/Questions/MultipleChoiceQuestion/MultipleChoiceQuestion.tsx
+++ b/client/src/components/Questions/MultipleChoiceQuestion/MultipleChoiceQuestion.tsx
@@ -1,8 +1,10 @@
// MultipleChoiceQuestion.tsx
-import React, { useState } from 'react';
-import Latex from 'react-latex';
+import React, { useEffect, useState } from 'react';
import '../questionStyle.css';
import { Button } from '@mui/material';
+import TextType from '../../GiftTemplate/templates/TextType';
+import { TextFormat } from '../../GiftTemplate/templates/types';
+import Latex from 'react-latex';
type Choices = {
feedback: { format: string; text: string } | null;
@@ -12,8 +14,7 @@ type Choices = {
};
interface Props {
- questionTitle: string | null;
- questionContent: string;
+ questionContent: TextFormat;
choices: Choices[];
globalFeedback?: string | undefined;
handleOnSubmitAnswer?: (answer: string) => void;
@@ -21,22 +22,24 @@ interface Props {
}
const MultipleChoiceQuestion: React.FC