mirror of
https://github.com/ets-cfuhrman-pfe/EvalueTonSavoir.git
synced 2025-08-11 21:23:54 -04:00
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:
commit
895a462d58
1 changed files with 1 additions and 10 deletions
|
|
@ -16,17 +16,8 @@ function formatLatex(text: string): string {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function escapeHTML(text: string) {
|
|
||||||
return text
|
|
||||||
.replace(/&/g, '&')
|
|
||||||
.replace(/</g, '<')
|
|
||||||
.replace(/>/g, '>')
|
|
||||||
.replace(/"/g, '"')
|
|
||||||
.replace(/'/g, ''');
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function TextType({ text }: TextTypeOptions): string {
|
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) {
|
switch (text.format) {
|
||||||
case 'moodle':
|
case 'moodle':
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue