From a15084a79b1df89876f1a4afdcde9fc300a14303 Mon Sep 17 00:00:00 2001 From: Anthony Geourjon <anthony.geourjon@tetras-libre.fr> Date: Wed, 18 Jun 2025 10:12:02 +0200 Subject: [PATCH] Fix double line break issue in json comment --- macao/assets/quiz.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/macao/assets/quiz.js b/macao/assets/quiz.js index 57d5bb5..5a3e991 100644 --- a/macao/assets/quiz.js +++ b/macao/assets/quiz.js @@ -12,9 +12,14 @@ function checkAllQuestions(questions, surveyConfig, converter) { if (allCorrect) { correctIndic.node.className = "correct"; + // convert \n\n into <br> tags for HTML rendering + surveyConfig.correctComment = surveyConfig.correctComment.replace(/\n\n/g, "<br>"); + correctIndic.commentNode.innerHTML = converter.renderInline(surveyConfig.correctComment) || "All answers are correct!"; } else { correctIndic.node.className = "incorrect"; + // convert \n\n into <br> tags for HTML rendering + surveyConfig.incorrectComment = surveyConfig.incorrectComment.replace(/\n\n/g, "<br>"); correctIndic.commentNode.innerHTML = converter.renderInline(surveyConfig.incorrectComment) || "Some answers are incorrect!"; } } -- GitLab