Merge pull request #92 from ets-cfuhrman-pfe/fuhrmanator/issue84

Quick fix pour supporter l'utilisation au DEG. 
Utilisation de > dans mathjax ne fonctionne pas
This commit is contained in:
Christopher (Cris) Fuhrman 2024-09-14 11:49:35 -04:00 committed by GitHub
commit 895a462d58
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -16,17 +16,8 @@ function formatLatex(text: string): string {
);
}
function escapeHTML(text: string) {
return text
.replace(/&/g, '&')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&#039;');
}
export default function TextType({ text }: TextTypeOptions): string {
const formatText = formatLatex(escapeHTML(text.text.trim()));
const formatText = formatLatex(text.text.trim()); // latex needs pure "&", ">", etc. Must not be escaped
switch (text.format) {
case 'moodle':